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 19:44:40 +0600 Message-ID: References: <83o8s0on41.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="51415"; 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 15:45:36 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 1jMXUu-000DFH-O2 for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Apr 2020 15:45:36 +0200 Original-Received: from localhost ([::1]:49560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMXUt-0005ZG-Pc for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Apr 2020 09:45:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60343) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMXUG-0004yN-QF for emacs-devel@gnu.org; Thu, 09 Apr 2020 09:44:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMXUF-0000VB-Nc for emacs-devel@gnu.org; Thu, 09 Apr 2020 09:44:56 -0400 Original-Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:41795) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMXUE-0000Um-1V; Thu, 09 Apr 2020 09:44:54 -0400 Original-Received: by mail-wr1-x42f.google.com with SMTP id h9so11977305wrc.8; Thu, 09 Apr 2020 06:44:53 -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=wPV7w2HdUojayuVithUP0uM2pZPY/+9TemHMTBDUxe0=; b=aXNF31vqEIFhJ8XcP9wZ/g7yfFs3Sx6ZW2Ty8sYJxmKdWAe7odjZC6WtJoti+l6XLT +m2Qy1lMqFfhK340PDtw/ZwU5BiKwNYXvKK8RjlyB3ZpS7qOOJr1qPLBWuAwqlGYUOCg u6PfhUwvCeDbxrAJ7MfDVVZMTyc78qc0OTy7nZvFwIUU6cldYB5MaTQQjmTB1HIxOqu9 Ngw21Vm4txnT0IvBIhwWmNAlv/wt05qG/cv63EZrRUphN7DmR4UZ5Qf3M2LYAP3HNlSs dBXvG3w1Tg9Xrvkap/GbCn6iSjzDpHRs02DxgG+QdIZ6AiyTyrRHsp0m5fwx6VyV0vz3 texg== 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=wPV7w2HdUojayuVithUP0uM2pZPY/+9TemHMTBDUxe0=; b=ozN6e3nbw6O2TpXAYz+GAhx8cclHHDXBn5+eeD2yEu06KpuKMC+CS4Ifrrcqw7Ixrq lXlv/hFrL4gPClyFxlFxlyDZZWd1Hc7BwoRoPJrYVJyKD9P+ReyRRLaOe38XbuQD0JF+ 0nJQQwfNozQrn+QD3+hBWd8WKW0glMRS11VHCPhEyfMHNfMDx8UO8HeDN6y2Ewq0ZC8H S+0ep06gbVa5TiN1DdbGVWQaY+7sxJS0IJR3SDtOWOZ0iocQf1Rf//u5tPoKQfqiPfLn FVIQboZy3lDN317F1qi86Nux+IslfWF9mzZObDVvQpV2UtiAZIITpLl65rBlmm9NBQn/ jDoQ== X-Gm-Message-State: AGi0PuYiD+NXQkZooKZuoDNH1oP3tI0ExGFIGZBSfSVjUkLgmr5wGyJ/ +9nLUFebdpxuN2pf+NoYFJ3kcAUXBHshJ8l6Bd79HcHQ X-Google-Smtp-Source: APiQypIo1DDxQRPBaL2K5Xa1lQbC7zkL3vk4M8aGbfQxp+HC8Px19f7a6tGdreeTXM/fcvFyygSIEgNJ9YVDJCiHB34= X-Received: by 2002:adf:bb94:: with SMTP id q20mr5242024wrg.105.1586439891873; Thu, 09 Apr 2020 06:44:51 -0700 (PDT) In-Reply-To: <83o8s0on41.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42f 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:246709 Archived-At: > 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. > (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. =D1=87=D1=82, 9 =D0=B0=D0=BF=D1=80. 2020 =D0=B3. =D0=B2 18:33, Eli Zaretski= i : > > > From: Dmitrii Korobeinikov > > Date: Thu, 9 Apr 2020 17:59:04 +0600 > > > > So, as far as I can see, defaulting to a higher threshold with an idle > > timer could yield better user experience with practically no > > significant tradeoffs. Is there something I might be missing here? > > 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 > (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. > > Now, I'm not saying that we cannot or shouldn't increase the default > GC threshold, but we must keep these two aspects in mind while > discussing this.