From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Trevor Bentley Newsgroups: gmane.emacs.bugs Subject: bug#43389: 28.0.50; Emacs memory leaks using hard disk all time Date: Wed, 25 Nov 2020 20:06:21 +0100 Message-ID: <87lfeptfwy.fsf@mail.trevorbentley.com> References: <86y2j2brg2.fsf@protected.rcdrun.com> <83blfxth7c.fsf@gnu.org> <83y2j0qb2v.fsf@gnu.org> <831rgppg3w.fsf@gnu.org> <83zh3czbvz.fsf@gnu.org> <83blfovzxz.fsf@gnu.org> <87o8jnu5f2.fsf@mail.trevorbentley.com> <83o8jmu49z.fsf@gnu.org> <87ft4ytw2c.fsf@mail.trevorbentley.com> <83d002tuoo.fsf@gnu.org> <87d001u46f.fsf@mail.trevorbentley.com> <83d001s50b.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36390"; mail-complaints-to="usenet@ciao.gmane.io" Cc: fweimer@redhat.com, 43389@debbugs.gnu.org, bugs@gnu.support, dj@redhat.com, carlos@redhat.com, michael_heerdegen@web.de, To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 25 20:07:15 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 1ki08I-0009M4-Iu for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Nov 2020 20:07:14 +0100 Original-Received: from localhost ([::1]:59650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ki08H-0002Cl-KO for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Nov 2020 14:07:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ki086-0002Aw-Ry for bug-gnu-emacs@gnu.org; Wed, 25 Nov 2020 14:07:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53702) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ki086-0006yn-KA for bug-gnu-emacs@gnu.org; Wed, 25 Nov 2020 14:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ki086-0006RC-Ft for bug-gnu-emacs@gnu.org; Wed, 25 Nov 2020 14:07:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Trevor Bentley Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Nov 2020 19:07: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.160633119024707 (code B ref 43389); Wed, 25 Nov 2020 19:07:02 +0000 Original-Received: (at 43389) by debbugs.gnu.org; 25 Nov 2020 19:06:30 +0000 Original-Received: from localhost ([127.0.0.1]:37015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ki07a-0006QR-D1 for submit@debbugs.gnu.org; Wed, 25 Nov 2020 14:06:30 -0500 Original-Received: from mail.trevorbentley.com ([37.187.5.80]:58073) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ki07Y-0006QD-5K for 43389@debbugs.gnu.org; Wed, 25 Nov 2020 14:06:28 -0500 Original-Received: from localhost (c188-150-0-48.bredband.comhem.se [188.150.0.48]) by mail.trevorbentley.com (Postfix) with ESMTPSA id 54A5B60C47; Wed, 25 Nov 2020 20:06:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.trevorbentley.com; s=mail; t=1606331182; bh=2ZRLeF1eP/nnbgfS+yrBEXneWHKnoN0jcASYf9tmRPQ=; h=From:To:Cc:Cc:Subject:In-Reply-To:References:Date:From; b=Bka7SpRat6SsETWTrSnAYD5N7YaAxXjvTjk19cRadWGOZGTFToo7uTmVc+R5Rxv+m Ira0gFlp2Gsqh7B5yELU3jcpy43teBR9DVnOBn6MQcH8lbJbdQuxFeNhlxMLMrpwf/ sNIEavDErk/BPytfhyygwx3MX2t+01EoRVcVoE64= In-Reply-To: <83d001s50b.fsf@gnu.org> 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:194226 Archived-At: Eli Zaretskii writes: > Then I don't think we will be able to understand what consumes > memory at such high rate without some debugging. Have you > considered using breakpoints and collecting backtraces, as I > suggested earlier? Next up will be libmtrace, and then I can look into gdb. It's going to be really noisy... we'll see how it goes. > > So the result of GC shows only tells you how much of the memory > was freed but NOT returned to glibc, it doesn't show how much > was actually free'd. > >> I'm wondering how to figure out how much memory a call to >> (garbage-collect) has actually freed. Possibly a sort of "dry >> run" where it performs the GC algorithm, but doesn't release >> any memory. > > "Freed" in what sense? returned to glibc? I was referring to glibc malloc/free, but emacs internal allocations would also be interesting. It's a moot point, as I don't think emacs supports it. In short, the question is "what has garbage-collect done?" It prints the state of memory after it is finished, but I have no idea if it has actually "collected" anything. >> As far as I understand, garbage collection is supposed to >> happen automatically during idle. I would certainly notice if >> it locked up the whole instance for 10 minutes from an idle >> GC. I think this means the automatic garbage collection is >> either not happening, or running on a different thread, or >> being interrupted, or simply works differently. I have no >> idea, hence asking you :) > > That is very strange. There's only one function to perform GC, > and it is called both from garbage-collect and from an internal > function called when Emacs is idle or when it calls interpreter > functions like 'eval' or 'funcall'. The only thing > garbage-collect does that the internal function doesn't is > generate the list that is the return value of garbage-collect, > but that cannot possibly take minutes. > > I suggest to set garbage-collection-messages non-nil, then you > should see when each GC, whether the one you invoke > interactively or the automatic one, starts and ends. maybe the > minutes you wait are not directly related to GC, but to > something else that is triggered by GC? I just set garbage-collection-messages to non-nil and evaluated (garbage-collect), and nothing was printed... you are suggesting that it should print something to *Messages*, right? I've never tried emacs's profiler. I'll try that next time I do a big garbage-collect and see what it shows. -Trevor