emacs-devel
[Top][All Lists]
Advanced

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

Re: Indentation and gc


From: Ihor Radchenko
Subject: Re: Indentation and gc
Date: Mon, 13 Mar 2023 12:45:34 +0000

Eli Zaretskii <eliz@gnu.org> writes:

>> Well. Currently, the paragraph reads like: we have 800kb default, but do
>> not increase it too much because Emacs will require more memory.
>
> No, it says more.  In particular:
>
>                   If you specify a larger value, garbage collection will
>      happen less often.  This reduces the amount of time spent garbage
>      collecting, but increases total memory use.  You may want to do
>      this when running a program that creates lots of Lisp data.
>      However, we recommend against increasing the threshold for
>      prolonged periods of time, and advise that you never set it higher
>      than needed for the program to run in reasonable time.  Using
>      thresholds higher than necessary could potentially cause
>      system-wide memory pressure, and should therefore be avoided.

Unfortunately, if is not very clear how much increasing the threshold
affects memory usage. What if I increase the threshold twice? Is it
safe? Dangerous? Maybe 10%? 10x?

I guess we can give an answer if we collect usage statistics.

>> Given that modern computer typically have 4-16Gb RAM, the warning does
>> not look like an actual warning. 800kb is nothing. Surely, increasing it
>> to 80Mb to even few hundreds Mb is safe, right? Or not?
>
> Again, you are reasoning about the value as if it were related to the
> maximum memory footprint Emacs could have.  But in fact, it is related
> only to the _increment_ of memory Emacs can have before it should stop
> and consider how much of that is garbage.

But how else should I interpret "memory pressure"? In practical terms,
it looks like increasing the threshold will make Emacs GC less - a good
thing if GCs are a problem. But then there is a warning about memory
pressure, but it does not look too scary if you have plenty of RAM,
especially looking at common advises to increase the threshold across
internet.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

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