From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Indentation and gc Date: Sat, 11 Mar 2023 13:31:04 +0000 Message-ID: <878rg3wh2f.fsf@localhost> References: <20230310110747.4hytasakomvdyf7i.ref@Ergus> <20230310110747.4hytasakomvdyf7i@Ergus> <87a60k657y.fsf@web.de> <838rg4zmg9.fsf@gnu.org> <87ttys4dge.fsf@web.de> <83sfebyepp.fsf@gnu.org> <87ttyru4zt.fsf@web.de> <83fsabyb41.fsf@gnu.org> <87mt4jtpqf.fsf@web.de> <83ilf7wi48.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27144"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "Dr. Arne Babenhauserheide" , spacibba@aol.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 11 14:30:39 2023 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 1pazJ0-0006tb-Fm for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Mar 2023 14:30:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pazI7-00007n-Go; Sat, 11 Mar 2023 08:29:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pazI4-00007Q-Bt for emacs-devel@gnu.org; Sat, 11 Mar 2023 08:29:40 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pazI2-0006BJ-9q for emacs-devel@gnu.org; Sat, 11 Mar 2023 08:29:40 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 4BC99240355 for ; Sat, 11 Mar 2023 14:29:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1678541376; bh=KU/9SAjZTNhrU5SeTKn1GRs/X2A25QgSQhTFNnUEDQY=; h=From:To:Cc:Subject:Date:From; b=LEp6/56FbVYvkAzxRY7WxvgZhqQJwGcXWJDSrgi/Q6mHFffBWYIU4zqbufkQaCP40 Sk/pAOlFNoNgPh6UB22z63lYgnHSxKB4XIDSvhtG/b+JIC/BtJ1Zw2xOY2TIVJHGsk zfHdYzGHnk2EFVsJiRXvBb/ZeyetI2OJyrcBzkxwzZ7zV86VDeJYt1eLE5hC2GDOC/ 5LMptSUL9OQUKX8tFsRGlaplVVX6NbK4j/WXck5gQcfQrWNzqj/KLJnJpmgQyizMpp 6nexi4G4Z651iESCHEa4FrBjPr9nIWcZK9USEJbTlI2DFdaIhrjtVWUajlt00tPdSz 95udTwZHGjZAQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PYkKn27b3z6tmv; Sat, 11 Mar 2023 14:29:33 +0100 (CET) In-Reply-To: <83ilf7wi48.fsf@gnu.org> Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304309 Archived-At: Eli Zaretskii writes: >> With the main risk being that we could go OOM, could Emacs evaluate the >> available memory on the system on systems that support that check? > > It can, but what would you want to do with that value? > > We cannot use it as the threshold, for the reasons I explained > earlier. We could use some fraction of it, but what fraction? The > answer depends on what other programs routinely run on that system. > For example, if the user is likely to run another full-fledged session > of Emacs (some people actually do that, e.g., to run Gnus in a > separate process), then using 1/2 of the amount of VM as the threshold > is out of the question, right? And there are memory-hogging programs > out there which use much more than Emacs does. What is the smallest practical free RAM available to Emacs on low-end systems? We can take that value and then use 800kb/min free RAM in the wild and the base threshold. On system with larger RAM the threshold will scale. As a speculation, let's assume that the minimal sane memory we can encounter is 128Mb. Then, 800kb correspond to ~0.7% RAM. For systems with a lot of RAM, Say 128Gb, 0.7% corresponds to 890Mb. Probably a bit much and will cause memory fragmentation What about the default being: (pcase (* (car (memory-info)) ; in kb 1000) (`nil 800000) ; 800kb, old default (ram (let ((scaled-threshold (* 0.7e-2 ; 800kb/128Mb for low-end systems. ram))) (min (* 100 1000 1000) ; upper limit to avoid fragmentation scaled-threshold)))) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at