From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Garbage collector: is 800kb a good default? Date: Thu, 09 Apr 2020 17:02:38 +0300 Message-ID: <83imi8oiyp.fsf@gnu.org> References: <83o8s0on41.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="3416"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Dmitrii Korobeinikov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 09 16:03:42 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jMXmQ-0000gv-Ho for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Apr 2020 16:03:42 +0200 Original-Received: from localhost ([::1]:50490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMXmP-0008RZ-HT for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Apr 2020 10:03:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37138) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMXlj-00081i-3w for emacs-devel@gnu.org; Thu, 09 Apr 2020 10:03:04 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jMXli-00026k-Us; Thu, 09 Apr 2020 10:02:59 -0400 Original-Received: from [176.228.60.248] (port=1213 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jMXli-0005Ae-9U; Thu, 09 Apr 2020 10:02:58 -0400 In-Reply-To: (message from Dmitrii Korobeinikov on Thu, 9 Apr 2020 19:44:40 +0600) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:246712 Archived-At: > From: Dmitrii Korobeinikov > Date: Thu, 9 Apr 2020 19:44:40 +0600 > Cc: emacs-devel > > > Two things: (1) the timer will not run as long as Emacs is running > > some prolonged calculation, which could produce a lot of garbage; and > > True, that's a reason for not making it too high. Emacs would also > freeze very noticably in those cases. But I think the threshold > doesn't have to be very high to reap most of the the benefits. For > example, I am testing 80MB at the moment. Pretty sure I would be > satisfied with half that. By satisfied I mean 3.5k lines of scroll > action would still be plenty (before a ~1/3-1/2 second gc freeze > happens) and the startup time would be shaved off quite close to the > apparent limit anyway. The "right" value depends on your usage patterns, among other factors. How to account for that in the default value? > > (2) you seem to ignore the increased memory pressure on the rest of > > the system from the growing memory footprint of Emacs. On GNU/Linux, > > Emacs doesn't really return malloc'ed memory to the system, so once > > the memory footprint grows, it more or less stays that way even after > > GC. > > Didn't know about that. A ground of reasoning here could be what the > average user would see as acceptable. Of course, there are also people > who optimize their system for memory consumption. But they are > probably tech-savvy enough to find the gc options anyway. The effect also depends on how much VM does the user have on his/her system, and what other applications routinely run there. Since we are talking about defaults, we should find a setting that is safe, i.e. works for everyone.