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:08:23 +0200

> From: "Dr. Arne Babenhauserheide" <arne_bab@web.de>
> Cc: spacibba@aol.com, emacs-devel@gnu.org
> Date: Sat, 11 Mar 2023 13:34:54 +0100
> 
> > Perhaps the only thing we could do is enlarge the value slightly in
> > Emacs 30.
> 
> That could already help, yes. Maybe not by factor 25 as I did (that’s
> mostly for lsp work), but just adjusting to how much the lower limit of
> systems changed that can run Emacs 30.

No, a factor of 25 is definitely too much.  I'd say maybe 4 or 5.

> > So raising the threshold indirectly raises the probability of having
> > your system run out of memory, even if the threshold value is way
> > below the amount of VM you have.
>
> > See above: to what value will you enlarge it so that it's still safe?
> > The Emacs startup typically does a lot of non-trivial stuff, so could
> > consume large quantities of memory.
> 
> 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.

> If Emacs can give back memory to the OS (I expect that it can, but I am
> not sure¹)

It depends...  In some situations (and some OSes), it doesn't.

> ¹: Can Emacs give back memory to the OS?

Depends on the implementation of malloc and on memory fragmentation.



reply via email to

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