From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#43389: 28.0.50; Emacs memory leaks Date: Thu, 12 Nov 2020 16:24:48 +0200 Message-ID: <83lff6zm8f.fsf@gnu.org> References: <87r1r5428d.fsf@web.de> <874kmcvlbj.fsf@mail.trevorbentley.com> <83imasb0te.fsf@gnu.org> <871rgzvbme.fsf@mail.trevorbentley.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29049"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43389@debbugs.gnu.org To: Trevor Bentley Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 12 15:25:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kdDXB-0007Qx-Sz for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Nov 2020 15:25:09 +0100 Original-Received: from localhost ([::1]:44998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdDXB-00029l-03 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Nov 2020 09:25:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdDX4-00029d-U7 for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 09:25:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60730) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kdDX4-0006fa-JA for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 09:25:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kdDX4-0004Hl-E4 for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 09:25:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Nov 2020 14:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43389 X-GNU-PR-Package: emacs Original-Received: via spool by 43389-submit@debbugs.gnu.org id=B43389.160519108416443 (code B ref 43389); Thu, 12 Nov 2020 14:25:02 +0000 Original-Received: (at 43389) by debbugs.gnu.org; 12 Nov 2020 14:24:44 +0000 Original-Received: from localhost ([127.0.0.1]:44043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdDWm-0004H9-CO for submit@debbugs.gnu.org; Thu, 12 Nov 2020 09:24:44 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdDWi-0004Gu-HS for 43389@debbugs.gnu.org; Thu, 12 Nov 2020 09:24:42 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52757) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdDWd-0006XR-3v; Thu, 12 Nov 2020 09:24:35 -0500 Original-Received: from [176.228.60.248] (port=2708 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kdDWc-0002M8-Fj; Thu, 12 Nov 2020 09:24:34 -0500 In-Reply-To: <871rgzvbme.fsf@mail.trevorbentley.com> (message from Trevor Bentley on Wed, 11 Nov 2020 22:15:21 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:193162 Archived-At: > From: Trevor Bentley > Cc: 43389@debbugs.gnu.org > Date: Wed, 11 Nov 2020 22:15:21 +0100 > > The raw massif output: > > http://trevorbentley.com/massif.out.3364630 > > The *full* tree output: > > http://trevorbentley.com/ms_print.3364630.txt > > The tree output showing only entries above 10% usage: > > http://trevorbentley.com/ms_print.thresh10.3364630.txt > > What you can see from the handy ASCII graph at the top is that > memory usage was chugging along, growing upwards for a couple of > days, and then spiked very quickly up to just over 4GB over a few > hours. When this pick happens, I see the following unusual circumstances: . ImageMagick functions are called and request a lot of (aligned) memory; . something called "gomp_thread_start" is called, and also allocates a lot of memory -- does this mean additional threads start running? Or am I reading the graphs incorrectly? Also, I see that you are using the native-compilation branch, and something called slack-image is being loaded? What is this about? And can you tell me whether src/config.h defines DOUG_LEA_MALLOC to a non-zero value on that system? > If you scroll down to the very last checkpoint (the 10% threshold > file is better for this), you can see where most of the memory is > used. Very large sums of memory, but from different sources. > 1.7GB from lisp_align_malloc (nearly all from Fcons), 1.4GB from > lmalloc (half from allocate_vector_block), 700MB from lrealloc > (mostly from enlarge_buffer_text). > > There were no large buffers open, but there were long-lived > network sockets and plenty of timers. I didn't check, but I'd say > the largest buffer was up to a couple of megabytes, since > emacs-slack logs fairly heavily. > > I'm not sure what to make of this, really. It seems like a > general, sudden-onset, intense craving for more memory while not > particularly doing much. I could blindly suggest extreme memory > fragmentation problems, but that doesn't seem very likely. It is important to understand what was going one when the memory started growing fast. You say there were no large buffers, but what about temporary buffers? what could cause gomp_thread_start, whatever that is, to start? We recently added a malloc-info command, maybe you could use it to show more information about the malloc arenas before and after it starts to eat up memory.