[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Larger GC thresholds for non-interactive Emacs
From: |
Stefan Monnier |
Subject: |
Re: Larger GC thresholds for non-interactive Emacs |
Date: |
Sat, 18 Jun 2022 09:16:41 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Ihor Radchenko [2022-06-18 13:35:04] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> BTW, I seen everyone's focused on `gc-cons-threshold` but that variable
>> does not adapt to the heap size, so maybe we'd be better off
>> playing with `gc-cons-percentage`.
> I am not sure if `gc-cons-percentage' is reliable.
>From where I stand it's the only one that's reliable.
It basically controls the percentage of *time* we spend in the GC: if we
assume that the time to perform a GC is proportional to the heap size,
and that the allocation rate (in MB/s) is more or less constant, then
`gc-cons-percentage' directly controls the percentage of time spent in
the GC.
Of course, those two assumptions don't hold exactly, but they're fairly
good approximations of reality.
Tweaking `gc-cons-threshold` on the other hand is very coarse and
brittle: if the value is significantly smaller than the heap, then we'll
spend too much time in the GC and if it's significantly larger then we
waste a lot of memory on garbage. There simply can't be any "one good
value" for `gc-cons-threshold`.
> When we have a small heap (at the beginning of the batch command run),
> the GC will be triggered frequently.
Yes, but the GC cycles will finish quickly.
Stefan
- Re: Org mode and Emacs (was: Convert README.org to plain text README while installing package), (continued)
- Re: Org mode and Emacs (was: Convert README.org to plain text README while installing package), Mattias EngdegÄrd, 2022/06/16
- Re: Org mode and Emacs (was: Convert README.org to plain text README while installing package), Ihor Radchenko, 2022/06/16
- Re: Org mode and Emacs, Stefan Monnier, 2022/06/16
- Larger GC thresholds for non-interactive Emacs (was: Org mode and Emacs), Ihor Radchenko, 2022/06/17
- Re: Larger GC thresholds for non-interactive Emacs, Stefan Monnier, 2022/06/17
- Re: Larger GC thresholds for non-interactive Emacs, Lars Ingebrigtsen, 2022/06/17
- Re: Larger GC thresholds for non-interactive Emacs, Lars Ingebrigtsen, 2022/06/17
- Re: Larger GC thresholds for non-interactive Emacs, Stefan Monnier, 2022/06/17
- Re: Larger GC thresholds for non-interactive Emacs, Lars Ingebrigtsen, 2022/06/17
- Re: Larger GC thresholds for non-interactive Emacs, Ihor Radchenko, 2022/06/18
- Re: Larger GC thresholds for non-interactive Emacs,
Stefan Monnier <=
- Re: Larger GC thresholds for non-interactive Emacs, Stefan Monnier, 2022/06/17
- Re: Larger GC thresholds for non-interactive Emacs, Lars Ingebrigtsen, 2022/06/17
- Re: Larger GC thresholds for non-interactive Emacs, Alan Mackenzie, 2022/06/17
- Re: Larger GC thresholds for non-interactive Emacs, Stefan Monnier, 2022/06/17
- Re: Larger GC thresholds for non-interactive Emacs, Lars Ingebrigtsen, 2022/06/17
- Re: Larger GC thresholds for non-interactive Emacs, Stefan Monnier, 2022/06/17
- Re: Larger GC thresholds for non-interactive Emacs, Eli Zaretskii, 2022/06/18
- Re: Larger GC thresholds for non-interactive Emacs, Lars Ingebrigtsen, 2022/06/18
- Re: Larger GC thresholds for non-interactive Emacs, Stefan Monnier, 2022/06/18
- Re: Larger GC thresholds for non-interactive Emacs, Stefan Monnier, 2022/06/17