emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Indentation and gc


From: Eli Zaretskii
Subject: Re: Indentation and gc
Date: Sat, 11 Mar 2023 15:44:18 +0200

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: "Dr. Arne Babenhauserheide" <arne_bab@web.de>, 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]