From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Indentation and gc Date: Sat, 11 Mar 2023 15:44:18 +0200 Message-ID: <83cz5fwggd.fsf@gnu.org> 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> <878rg3wh2f.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17089"; mail-complaints-to="usenet@ciao.gmane.io" Cc: arne_bab@web.de, spacibba@aol.com, emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 11 14:45:16 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 1pazXA-0004Ba-42 for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Mar 2023 14:45:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pazWW-0007fj-40; Sat, 11 Mar 2023 08:44:36 -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 1pazWU-0007fb-84 for emacs-devel@gnu.org; Sat, 11 Mar 2023 08:44:34 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pazWT-0000sO-PQ; Sat, 11 Mar 2023 08:44:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=IJB6p0wqTsX6CN2pFhAhRUto1BBTPpNbbhiDuFbC/OA=; b=Oe2H8QiYflK3 VnjdoVT4Hv7lRaXKWVjdjmf4rTpO7Iu70Lnz0ZRbDaYqB+DZIej9kREEZgsVUXmhY+3JJsUAuyLoT 2JJP3gK3++dv+kK5mbstAOh9DrUojFksQ0LDNoZ+2+sY8JB1uhlnBRTLc62f/awBweZ+j9SwU6dPr rOWglj3Nj8FUVOKglIQ1vg3y7TbwTrYlDQRFR/sYanPUFziwAWPj99o8AOeRIbYA4LJC3LV2KQNG3 o+OcArCZDARrJ348p3mINPg7GGgqm68Uzrp0NxXTkOTPuGgrzC65GjfpeZOcEdnFP+svr4YA4tKr6 jXWqE0RnbjVUIKMTJ2oeMw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pazWS-0003nc-6t; Sat, 11 Mar 2023 08:44:33 -0500 In-Reply-To: <878rg3wh2f.fsf@localhost> (message from Ihor Radchenko on Sat, 11 Mar 2023 13:31:04 +0000) 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:304313 Archived-At: > From: Ihor Radchenko > Cc: "Dr. Arne Babenhauserheide" , spacibba@aol.com, > emacs-devel@gnu.org > Date: Sat, 11 Mar 2023 13:31:04 +0000 > > 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)))) The above implicitly assumes that gc-cons-threshold is the absolute ceiling of the memory Emacs can allocate. But that is not what that threshold means and how it is used. Even with the default threshold of 800K a running Emacs session can allocate much more than 800K bytes. Therefore, the reasoning about the value should be different.