From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#37006: 27.0.50; garbage collection not happening after 26de2d42 Date: Thu, 15 Aug 2019 22:34:27 +0300 Message-ID: <83mugap6ik.fsf@gnu.org> References: <5075406D-6DB8-4560-BB64-7198526FCF9F@acm.org> <83h86nu0pq.fsf@gnu.org> <86pnlbphus.fsf@phe.ftfl.ca> <83a7cft8qx.fsf@gnu.org> <868srysb9x.fsf@phe.ftfl.ca> <83wofis508.fsf@gnu.org> <2687613f-ba89-25cf-9517-5311106aef9a@cs.ucla.edu> <83ef1prly5.fsf@gnu.org> <0bc956d1-4cf5-a886-1703-49ee0aeb3d58@cs.ucla.edu> <83v9uzrasm.fsf@gnu.org> <18886155-d96b-ae07-1df2-1b1d58a8bbb2@cs.ucla.edu> <83o90qqzqw.fsf@gnu.org> <58673b86-d27f-c839-2eb6-bd0cbe7a70a5@cs.ucla.edu> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="66349"; mail-complaints-to="usenet@blaine.gmane.org" Cc: jrm@ftfl.ca, mattiase@acm.org, 37006@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 15 21:35:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1hyLWg-000H9R-Lp for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Aug 2019 21:35:10 +0200 Original-Received: from localhost ([::1]:46622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyLWf-0005qj-Gx for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Aug 2019 15:35:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45869) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyLWZ-0005q2-9S for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 15:35:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hyLWY-0003dW-1C for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 15:35:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43654) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hyLWX-0003dK-Tx for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 15:35:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hyLWX-0005iO-Nd for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 15:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Aug 2019 19:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37006 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 37006-submit@debbugs.gnu.org id=B37006.156589768521943 (code B ref 37006); Thu, 15 Aug 2019 19:35:01 +0000 Original-Received: (at 37006) by debbugs.gnu.org; 15 Aug 2019 19:34:45 +0000 Original-Received: from localhost ([127.0.0.1]:52475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyLWG-0005hr-Lq for submit@debbugs.gnu.org; Thu, 15 Aug 2019 15:34:44 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyLWE-0005hb-Im for 37006@debbugs.gnu.org; Thu, 15 Aug 2019 15:34:43 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hyLW8-0003Ok-Ld; Thu, 15 Aug 2019 15:34:36 -0400 Original-Received: from [176.228.60.248] (port=4402 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hyLW8-0006fQ-1i; Thu, 15 Aug 2019 15:34:36 -0400 In-reply-to: <58673b86-d27f-c839-2eb6-bd0cbe7a70a5@cs.ucla.edu> (message from Paul Eggert on Thu, 15 Aug 2019 11:51:06 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:165140 Archived-At: > Cc: jrm@ftfl.ca, mattiase@acm.org, 37006@debbugs.gnu.org > From: Paul Eggert > Date: Thu, 15 Aug 2019 11:51:06 -0700 > > > most-positive-fixnum on 32-bit systems is large enough for > > every practical purpose. > > It's not that hard for the number of consed bytes to exceed most-positive-fixnum > on a 32-bit Emacs. Here's a simple test case to illustrate the phenomenon: > > (let* ((cons-size (car (cdr (car (garbage-collect))))) > (long-length (1+ (/ most-positive-fixnum cons-size))) > (l (make-list long-length nil))) > (cons most-positive-fixnum (* cons-size (length l)))) > > This yielded (536870911 . 536870912) on the 32-bit Emacs that I just built. Of > course a practical application would likely have a bunch of smaller lists, but > the same basic idea applies. On such a platform, a user who wants to disable GC > while fiddling with a bunch of large lists will need to set gc-cons-threshold to > a bignum. I don't see why we must complicate our code to support such a use case. Users who want to disable GC while consing so much object will have to learn that they cannot, not on a 32-bit machine. > > supporting the full 32 bits (and 64 > > bits in 64-bit builds) will also allow contradictory situation whereby > > gc-cons-threshold is higher than what we say should be used to disable > > GC. > > Sorry, I'm not following. If setting gc-cons-threshold to a large value > effectively disables GC, then setting gc-cons-threshold to a larger value should > do the same thing. most-positive-fixnum is infinity for this purpose, and there should not be numbers greater than infinity. It's confusing and hard to explain. > > Why do we need to talk about how many objects are there? GC threshold > > is not about counting objects, it's about deciding when to GC. > > The GC threshold is part of a related set of integers that count objects and > bytes, for use in the returned value of garbage-collect among other things. No, they are just a means to decide when it's a good time to GC. Very large values are used to effectively disable GC, very small values to cause GC "soon". That's all, there are no requirements to count objects or to have any accurate bookeeping of how many objects or bytes were consed. > > Are you working on that, or should someone else do it? > > I can add it to my list of things to do. To my mind, getting the timestamp API > nailed down is more urgent, though, because fiddling with GC heuristics doesn't > affect the API. Well, meanwhile we've broken a very popular use case, so I think fixing this is rather urgent. > > Right, but that's not what I proposed. I proposed to trigger an > > immediate GC only the first time we detect memory-full. Thereafter, > > the threshold will be set to 1KB, which should prevent thrashing. > > Isn't it more complicated than that? Emacs can be low on memory, but can then > get more and not be low on memory, and then be low on memory again later. Maybe so, but we had such code in Emacs for decades. I just want to avoid losing those features.