From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: Emacs memory management and sluggishness Date: Sun, 28 Jul 2019 01:52:19 +0200 Message-ID: <8736ir3uj0.fsf@telefonica.net> References: <87k1c44n7y.fsf@telefonica.net> <83d0hwm0fc.fsf@gnu.org> <87ef2b4pti.fsf@telefonica.net> <83sgqrlim1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="31991"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 28 01:52:40 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hrWUQ-00088a-9W for ged-emacs-devel@m.gmane.org; Sun, 28 Jul 2019 01:52:38 +0200 Original-Received: from localhost ([::1]:47636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hrWUO-0004fQ-SE for ged-emacs-devel@m.gmane.org; Sat, 27 Jul 2019 19:52:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54143) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hrWUH-0004fJ-4P for emacs-devel@gnu.org; Sat, 27 Jul 2019 19:52:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hrWUG-0001ch-2h for emacs-devel@gnu.org; Sat, 27 Jul 2019 19:52:29 -0400 Original-Received: from relayout01-redir.e.movistar.es ([86.109.101.201]:58905) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hrWUE-0001Ks-I5; Sat, 27 Jul 2019 19:52:26 -0400 Original-Received: from sky (162.red-79-151-6.dynamicip.rima-tde.net [79.151.6.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 981711563@telefonica.net) by relayout01.e.movistar.es (Postfix) with ESMTPSA id 45x2n00g9czfZbG; Sun, 28 Jul 2019 01:52:19 +0200 (CEST) X-CTCH-Score: 0.000 X-CTCH-ScoreCust: 0.000 X-TnetOut-Country: IP: 79.151.6.162 | Country: ES X-TnetOut-Information: AntiSPAM and AntiVIRUS on relayout01 X-TnetOut-MsgID: 45x2n00g9czfZbG.A61E7 X-TnetOut-SpamCheck: no es spam, Unknown X-TnetOut-From: ofv@wanadoo.es X-TnetOut-Watermark: 1564876342.79777@CrxMEsRQc37NCu+VFSPKQQ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 86.109.101.201 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:238956 Archived-At: Eli Zaretskii writes: >> Since my previous message RSS increased 30 MB. > > So I guess we have a memory leak somewhere. Not sure if we have good > ways of finding them. I think I'd suggest to update to the latest > master, and then track your memory footprint, waiting for the problem > to happen and taking notes of what features you invoke. Once the > problem happens again, it would be good to know which features were > activated and which commands invoked since the last checkpoint, so we > could look into what these features/commands do. It occurred to me to take a look at M-x list-timers and it showed about 700 (seven hundred) of them. The most frequent was about 300 repetitions of * 0.05 t aggressive-indent--indent-if-changed which is created by aggressive-indent-mode, that I use on a subset of my buffers, then several dozens of * 0.50 t pdf-cache--prefetch-start which comes from pdf-tools, and dozens of 6467.37 - password-cache-remove (the Next number varies, of course). So I used cancel-function-timers to get rid of all the instances of those 3 examples and the lag while typing text went away. Then, on new Emacs sessions (both with -Q and with my config) tried to replicate the accumulation of aggressive-indent--indent-if-changed without success. Then noticed that everytime I fetch news & email with Gnus 6 new instances of password-cache-remove are added. I checked that this behavior is present since at least emacs 26.1. It makes little sense to me, but those timers will eventually expire. Why the other timers accumulate, don't know. Is it possible that the huge RAM usage is related to the existence of those hundreds of timers? Now I'll do what you advised: fresh build, fresh instance and watch for memory (and timers) increase. Thanks.