From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitrii Korobeinikov Newsgroups: gmane.emacs.devel Subject: Re: Garbage collector: is 800kb a good default? Date: Thu, 9 Apr 2020 20:46:53 +0600 Message-ID: References: <83o8s0on41.fsf@gnu.org> <83imi8oiyp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="74588"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 09 16:48:23 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 1jMYTf-000JJ7-5N for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Apr 2020 16:48:23 +0200 Original-Received: from localhost ([::1]:51002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMYTe-0001oZ-6f for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Apr 2020 10:48:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42324) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMYST-0000vA-VT for emacs-devel@gnu.org; Thu, 09 Apr 2020 10:47:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMYSS-0007jt-Oo for emacs-devel@gnu.org; Thu, 09 Apr 2020 10:47:09 -0400 Original-Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:52079) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMYSR-0007ij-2q; Thu, 09 Apr 2020 10:47:07 -0400 Original-Received: by mail-wm1-x32c.google.com with SMTP id x4so22799wmj.1; Thu, 09 Apr 2020 07:47:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ir8ZYh/eaxqMwHqnVpErvNdFL6NSh4p8oKCrc5oflTw=; b=EjPRuPG+Epj19Kr8XVMYdhd/nWc36+3M+A/cUdx1qcC4sT5/CbqWAnsgoY1RnVKsik eFEI917AI6gkzngw44QaylRGCwQspVQvO2kJvfR7gwDcdEHp6hRGlCVglCIwqVjkZb9m /LndI0AN6wb2rAzIGX9MLvOpwmH2YaBUQ0hXVFSjhnWCB6UvznuVhVq/3ycf2VHLKrbV pQsqyFv4law0cO9pYyE2IZwyrAynDLSdbZ6voFt53FtkcEGKCAfaYRTS5/ovhSgdeOWA BLL4WK5QmA1diq/aBIYC781poZqhM0cDcf6W1PnnzeU9mVKRquj/3mEybH6uLJsGsIhF XlEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ir8ZYh/eaxqMwHqnVpErvNdFL6NSh4p8oKCrc5oflTw=; b=koJore4DXcl/UnkEjlfu4mRqVN6nQWCFRC0A40xHgykaulffLx18gkgUONLcAVbR6v D/JsbQ0f3mm683dnBlb0oIyD2W4ThnYjSAXDDBSHZ4cYbYi5z2rQ6PeK6qdxSKkLpm52 uEaEfJt3Qrw+fK0juH4l6pwl+Do5EXoAyNc7La2RnIuCMwpi9c/4E8LMVrqxCRp4oT25 bGs9hQBg2qmrLIcnEPOShG+Y5tNo+MDAPYIidlLmnsRCUR8pD1KH7tw1Pm79c/cxhaKR NIEDqd5b2NtWxYRPI/3IeSqabl92mtFVa74fOhfB/7zinRyN+cSb6HBpPOsXHbMc3t1O iHCg== X-Gm-Message-State: AGi0PuYODrYtksDKaGb6XhRvBBee2/M1kFp8Np9nVyKLHHKGvp7BOOOi 5kJ+fYgOuqZPBgcEVxqd1BqfwiYb4zzqamfy09zVF8qVetA= X-Google-Smtp-Source: APiQypIgHBMS1oeak10+sdxr1i6FYogPoGYR9GBRS2UeAn35mysoY3E5gwTnaR8Ro015ixwzNamVr2/2Utb6i7990IA= X-Received: by 2002:a1c:9a87:: with SMTP id c129mr197049wme.149.1586443625133; Thu, 09 Apr 2020 07:47:05 -0700 (PDT) In-Reply-To: <83imi8oiyp.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32c 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:246716 Archived-At: > The "right" value depends on your usage patterns, among other > factors. How to account for that in the default value? I am not sure what you mean exactly by usage patterns. > Let's not forget that running GC while Emacs is idle will make Emacs > less responsive if the user starts typing while GC is in progress, > specially if gc-cons-threshold is high. So it isn't entirely "free". Maybe it would be possible to garbage collect in chunks and check after each chunk for input? Best, DK =D1=87=D1=82, 9 =D0=B0=D0=BF=D1=80. 2020 =D0=B3. =D0=B2 20:02, Eli Zaretski= i : > > > 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.