From unknown Sat Jun 14 01:38:31 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#1504 <1504@debbugs.gnu.org> To: bug#1504 <1504@debbugs.gnu.org> Subject: Status: 23.0.60; emacs daemon leaks memory Reply-To: bug#1504 <1504@debbugs.gnu.org> Date: Sat, 14 Jun 2025 08:38:31 +0000 retitle 1504 23.0.60; emacs daemon leaks memory reassign 1504 emacs submitter 1504 Markus Triska severity 1504 normal thanks From triska@gmx.at Sat Dec 6 03:20:30 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.9 required=4.0 tests=AWL,BAYES_00,FOURLA, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 6 Dec 2008 11:20:30 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB6BKR8H008574 for ; Sat, 6 Dec 2008 03:20:28 -0800 Received: from mail.gnu.org ([199.232.76.166]:46345 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L8vCV-0004vm-Jb for emacs-pretest-bug@gnu.org; Sat, 06 Dec 2008 06:19:55 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L8vCx-0003DG-NJ for emacs-pretest-bug@gnu.org; Sat, 06 Dec 2008 06:20:25 -0500 Received: from mail.gmx.net ([213.165.64.20]:58276) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1L8vCw-0003CB-R7 for emacs-pretest-bug@gnu.org; Sat, 06 Dec 2008 06:20:23 -0500 Received: (qmail invoked by alias); 06 Dec 2008 11:20:13 -0000 Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO mt-computer.local) [62.178.240.212] by mail.gmx.net (mp029) with SMTP; 06 Dec 2008 12:20:13 +0100 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX1918jFWcAZ1ogtxNCOfspwcJkHqHDaQf7pQ/5xc34 m2LMXSoTR7G3oj Received: by mt-computer.local (Postfix, from userid 502) id E93A0BD9391; Sat, 6 Dec 2008 12:20:09 +0100 (CET) From: Markus Triska To: emacs-pretest-bug@gnu.org Subject: 23.0.60; emacs daemon leaks memory Message-Id: <20081206112009.E93A0BD9391@mt-computer.local> Date: Sat, 6 Dec 2008 12:20:09 +0100 (CET) X-Y-GMX-Trusted: 0 X-FuHaFi: 0.52 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) When I do: $ emacs -Q --daemon followed by: $ while true; do emacsclient -t -e "(save-buffers-kill-terminal)"; done then the daemon apparently consumes increasingly more memory. In GNU Emacs 23.0.60.9 (i386-apple-darwin8.11.1, GTK+ Version 2.12.9) of 2008-11-28 on mt-computer.local Windowing system distributor `The XFree86 Project, Inc', version 11.0.40400000 Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_GB.UTF-8 value of $XMODIFIERS: nil locale-coding-system: nil default-enable-multibyte-characters: t From cyd@stupidchicken.com Sat Dec 6 10:25:56 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.0 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1504) by emacsbugs.donarmstrong.com; 6 Dec 2008 18:25:56 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB6IPsJN019355 for <1504@emacsbugs.donarmstrong.com>; Sat, 6 Dec 2008 10:25:55 -0800 Received: by cyd.mit.edu (Postfix, from userid 1000) id 6561C57E1D1; Sat, 6 Dec 2008 13:25:57 -0500 (EST) From: Chong Yidong To: Markus Triska Cc: 1504@debbugs.gnu.org Subject: Re: 23.0.60; emacs daemon leaks memory Date: Sat, 06 Dec 2008 13:25:57 -0500 Message-ID: <87hc5hcg96.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Could you check whether this happens with the ordinary Emacs server as well? From markus.triska@gmx.at Sat Dec 6 10:53:08 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.9 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1504) by emacsbugs.donarmstrong.com; 6 Dec 2008 18:53:08 +0000 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id mB6Ir5Pr025395 for <1504@emacsbugs.donarmstrong.com>; Sat, 6 Dec 2008 10:53:06 -0800 Received: (qmail invoked by alias); 06 Dec 2008 18:52:58 -0000 Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO mt-computer.local) [62.178.240.212] by mail.gmx.net (mp064) with SMTP; 06 Dec 2008 19:52:58 +0100 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX1/WWDNV8VjWQIOgEOMGOa+6QTGKHlDV6oq6cUyRN2 v1+HKiWmSjLlzb Received: by mt-computer.local (Postfix, from userid 502) id D56B5BD9A12; Sat, 6 Dec 2008 19:52:54 +0100 (CET) From: Markus Triska To: Chong Yidong Cc: 1504@debbugs.gnu.org Subject: Re: 23.0.60; emacs daemon leaks memory References: <87hc5hcg96.fsf@cyd.mit.edu> Date: Sat, 06 Dec 2008 19:52:54 +0100 In-Reply-To: <87hc5hcg96.fsf@cyd.mit.edu> (Chong Yidong's message of "Sat, 06 Dec 2008 13:25:57 -0500") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Y-GMX-Trusted: 0 X-FuHaFi: 0.75 Chong Yidong writes: > Could you check whether this happens with the ordinary Emacs server as When I do: $ emacs -nw -Q --eval "(server-start)" instead of "emacs -Q --daemon" above, it also uses more and more memory. From cyd@stupidchicken.com Sat Dec 6 17:15:53 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.0 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1504) by emacsbugs.donarmstrong.com; 7 Dec 2008 01:15:53 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB71Fon2026031 for <1504@emacsbugs.donarmstrong.com>; Sat, 6 Dec 2008 17:15:51 -0800 Received: by cyd.mit.edu (Postfix, from userid 1000) id 2D73157E1D1; Sat, 6 Dec 2008 20:15:54 -0500 (EST) From: Chong Yidong To: Markus Triska Cc: 1504@debbugs.gnu.org Subject: Re: 23.0.60; emacs daemon leaks memory References: <87hc5hcg96.fsf@cyd.mit.edu> Date: Sat, 06 Dec 2008 20:15:54 -0500 In-Reply-To: (Markus Triska's message of "Sat, 06 Dec 2008 19:52:54 +0100") Message-ID: <87r64k3hv9.fsf@cyd.mit.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Markus Triska writes: > When I do: > > $ emacs -nw -Q --eval "(server-start)" > > instead of "emacs -Q --daemon" above, it also uses more and more > memory. Does this memory increase persist across garbage collections? Also, could you check if Emacs 22 has a similar problem, or if it's new to Emacs 23? Thanks. From markus.triska@gmx.at Sun Dec 7 12:59:47 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.9 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1504) by emacsbugs.donarmstrong.com; 7 Dec 2008 20:59:48 +0000 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id mB7KxhAO008777 for <1504@emacsbugs.donarmstrong.com>; Sun, 7 Dec 2008 12:59:45 -0800 Received: (qmail invoked by alias); 07 Dec 2008 20:59:37 -0000 Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO mt-computer.local) [62.178.240.212] by mail.gmx.net (mp055) with SMTP; 07 Dec 2008 21:59:37 +0100 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX19zNZAyLHlzGUkn6KG+YramPjzGeOZ8TXGM41oCko Dz3SmZLf60f1Pr Received: by mt-computer.local (Postfix, from userid 502) id 4D0B4BDA379; Sun, 7 Dec 2008 21:59:30 +0100 (CET) From: Markus Triska To: Chong Yidong Cc: 1504@debbugs.gnu.org Subject: Re: 23.0.60; emacs daemon leaks memory References: <87hc5hcg96.fsf@cyd.mit.edu> <87r64k3hv9.fsf@cyd.mit.edu> Date: Sun, 07 Dec 2008 21:59:30 +0100 In-Reply-To: <87r64k3hv9.fsf@cyd.mit.edu> (Chong Yidong's message of "Sat, 06 Dec 2008 20:15:54 -0500") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Y-GMX-Trusted: 0 X-FuHaFi: 0.61 Chong Yidong writes: > Does this memory increase persist across garbage collections? Yes, unfortunately. > Also, could you check if Emacs 22 has a similar problem After trying, I found no similar problem in Emacs 22.3 so far. The test case does not translate directly to older Emacs versions, and in all compatible cases I tested, CVS and 22.3 performed equally well and OK. For example, when I do "emacs -Q -nw -f server-start" and evaluate: (defun myedit () (run-with-timer 0.1 nil 'server-edit)) (add-hook 'after-change-major-mode-hook 'myedit) Then $ while true; do emacsclient test.txt; done does not leak memory, regardless of which version I try it with. From cyd@stupidchicken.com Thu Dec 11 18:32:07 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0000 Tokens: new, 29; hammy, 48; neutral, 50; spammy, 2. spammytokens:0.979-8--accounts, 0.969-5--urgent hammytokens:0.000-+--emacs, 0.000-+--23060, 0.000-+--23.0.60, 0.000-+--Emacs, 0.000-+--H*M:fsf X-Spam-Status: No, score=-2.1 required=4.0 tests=BAYES_00,DATE_IN_PAST_03_06, RCVD_IN_PBL,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1504-done) by emacsbugs.donarmstrong.com; 12 Dec 2008 02:32:07 +0000 Received: from furry (c-71-235-91-189.hsd1.ct.comcast.net [71.235.91.189]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBC2W4hv020050 for <1504-done@emacsbugs.donarmstrong.com>; Thu, 11 Dec 2008 18:32:05 -0800 Received: by furry (Postfix, from userid 1000) id DC978C060; Thu, 11 Dec 2008 15:50:13 -0500 (EST) From: Chong Yidong To: Markus Triska Cc: 1504-done@debbugs.gnu.org Subject: Re: 23.0.60; emacs daemon leaks memory Date: Thu, 11 Dec 2008 15:50:13 -0500 Message-ID: <871vwecu7u.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Aha: Emacs wasn't freeing the frame face cache on tty frames. Fixed. This, plus a couple of other leaks in term.c that I fixed earlier this week, accounts for about 95% of the leakage you reported. There remains a smaller leak occurring in Lisp: see http://lists.gnu.org/archive/html/emacs-devel/2008-12/msg00443.html I'll continue looking into that, but it's less urgent because that leak is much, much slower. In the meantime, I'm closing the bug. Thanks for reporting. From markus.triska@gmx.at Fri Dec 12 16:12:58 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0000 Tokens: new, 18; hammy, 78; neutral, 48; spammy, 2. spammytokens:0.967-5--urgent, 0.884-2--severe hammytokens:0.000-+--emacs, 0.000-+--23.0.60, 0.000-+--23060, 0.000-+--H*M:fsf, 0.000-+--H*MI:fsf X-Spam-Status: No, score=-4.9 required=4.0 tests=AWL,BAYES_00, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1504) by emacsbugs.donarmstrong.com; 13 Dec 2008 00:12:58 +0000 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id mBD0CpsW028346 for <1504@emacsbugs.donarmstrong.com>; Fri, 12 Dec 2008 16:12:52 -0800 Received: (qmail invoked by alias); 13 Dec 2008 00:12:45 -0000 Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO mt-computer.local) [62.178.240.212] by mail.gmx.net (mp026) with SMTP; 13 Dec 2008 01:12:45 +0100 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX19w6nQZwIdwKlA/oPcf1NOZSfW+M+TQiYok3w81Vn T/dQ/jFUMmuHfh Received: by mt-computer.local (Postfix, from userid 502) id 69C0BBDFFAB; Sat, 13 Dec 2008 01:12:42 +0100 (CET) From: Markus Triska To: 1504@debbugs.gnu.org Cc: Chong Yidong Subject: Re: bug#1504 closed by Chong Yidong (Re: 23.0.60; emacs daemon leaks memory) References: <871vwecu7u.fsf@stupidchicken.com> <20081206112009.E93A0BD9391@mt-computer.local> Date: Sat, 13 Dec 2008 01:12:41 +0100 In-Reply-To: (Emacs bug Tracking System's message of "Thu, 11 Dec 2008 18:35:03 -0800") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Y-GMX-Trusted: 0 X-FuHaFi: 0.76 > it's less urgent because that leak is much, much slower. Serious emacsclient testing can only start when the leak is completely fixed: I'm trying to trace down a different problem (#1125) which only seems to happen after entering and exiting emacsclient occasionally. Still, thank you for the current fixes - I can now run the test cases for a few minutes instead of only seconds, which is already better. Also, when I use emacsclient with "-c" instead of "-t" in the test case, there's a leak that seems to be as severe as before your patches. From unknown Sat Jun 14 01:38:31 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Sat, 10 Jan 2009 15:24:03 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator