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: Tue, 24 Nov 2020 20:05:15 +0100 Message-ID: <87ft4ytw2c.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> 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="23696"; 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 Tue Nov 24 20:06:17 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 1khddo-00060o-Bo for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Nov 2020 20:06:16 +0100 Original-Received: from localhost ([::1]:37892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khddn-0008W5-A1 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Nov 2020 14:06:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khdda-0008VW-Nb for bug-gnu-emacs@gnu.org; Tue, 24 Nov 2020 14:06:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49704) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1khdda-0000Pm-Gj for bug-gnu-emacs@gnu.org; Tue, 24 Nov 2020 14:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1khdda-0008Tg-Am for bug-gnu-emacs@gnu.org; Tue, 24 Nov 2020 14:06: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: Tue, 24 Nov 2020 19:06: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.160624472432541 (code B ref 43389); Tue, 24 Nov 2020 19:06:02 +0000 Original-Received: (at 43389) by debbugs.gnu.org; 24 Nov 2020 19:05:24 +0000 Original-Received: from localhost ([127.0.0.1]:33017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1khdcy-0008Sl-GU for submit@debbugs.gnu.org; Tue, 24 Nov 2020 14:05:24 -0500 Original-Received: from mail.trevorbentley.com ([37.187.5.80]:51174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1khdcw-0008SX-U8 for 43389@debbugs.gnu.org; Tue, 24 Nov 2020 14:05:23 -0500 Original-Received: from localhost (c188-150-0-48.bredband.comhem.se [188.150.0.48]) by mail.trevorbentley.com (Postfix) with ESMTPSA id EA406607BA; Tue, 24 Nov 2020 20:05:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.trevorbentley.com; s=mail; t=1606244717; bh=lrZ4UZz4bniK0yXJj4ipYK+kJ+E7qoIIV1KYtbwXl6w=; h=From:To:Cc:Cc:Subject:In-Reply-To:References:Date:From; b=oJXBO9GDsFpZ1+DqwZwkA3zV74oitJV43/9Qaj47/e4W4x/Q0RApDf/pXGyQ8U8Za uTi2870XAE1qG9u3Ofi+TQe9hkTgvM/Lgqa7qP1Zl/tZrLOuOSxHv4q/JuKn2/rpsl sLgWkWIjQPsyUH9oNVjQW0uNIIE7qR0jLID6ok9k= In-Reply-To: <83o8jmu49z.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:194103 Archived-At: Eli Zaretskii writes: > > Look at the large chunks in the tail of this. Together, they do > account for ~2GB. > > Carlos, are these chunks in use (i.e. allocated and not freed), > or are they the free chunks that are available for allocation, > but not released to the OS? If the former, then it sounds like > this session does have around 2GB of allocated heap data, so > either there's some allocated memory we don't account for, or > there is indeed a memory leak in Emacs. If these are the free > chunks, then the way glibc manages free'd memory is indeed an > issue. I just updated the log on my website. Same instance a day later, after yet another memory spike up to 4.3GB. Concatenated to the end: https://trevorbentley.com/emacs_malloc_info.log Some interesting observations: - (garbage-collect) takes forever, like on the order of 5-10 minutes, with one CPU core pegged to 100% and emacs frozen. - The leaking stops for a while after (garbage-collect). It was leaking 1MB per second for this last log, and stopped growing after the garbage collection. Question 1: (garbage-collect) shows the memory usage *after* collecting, right? Is there any way to get the same info without actually reaping dead references? It could be that there really were 4.3GB of dead references. Question 2: are the background garbage collections equivalent to the (garbage-collect) function? I certainly don't notice 5-10 minute long pauses during normal use, though "gcs-done" is incrementing. Does it have a different algorithm for partial collection during idle, perhaps? Question 3: I've never used the malloc_trim() function. Could that be something worth experimenting with, to see if it releases any of the massive heap back to the OS? -Trevor