; Minor improvement of documentation of GC thresholds

* doc/lispref/internals.texi (Garbage Collection): More practical
aspects of enlarging the GC threshold.
This commit is contained in:
Eli Zaretskii 2023-03-11 18:16:35 +02:00
parent b0b24ad2fc
commit 0fedbfa6a9

View file

@ -558,13 +558,15 @@ The initial threshold value is @code{GC_DEFAULT_THRESHOLD}, defined in
value is 400,000 for the default 32-bit configuration and 800,000 for value is 400,000 for the default 32-bit configuration and 800,000 for
the 64-bit one. If you specify a larger value, garbage collection the 64-bit one. If you specify a larger value, garbage collection
will happen less often. This reduces the amount of time spent garbage will happen less often. This reduces the amount of time spent garbage
collecting, but increases total memory use. You may want to do this collecting (so Lisp programs will run faster between cycles of garbage
when running a program that creates lots of Lisp data. However, we collection that happen more rarely), but increases total memory use.
You may want to do this when running a program that creates lots of
Lisp data, especially if you need it to run faster. However, we
recommend against increasing the threshold for prolonged periods of recommend against increasing the threshold for prolonged periods of
time, and advise that you never set it higher than needed for the time, and advise that you never set it higher than needed for the
program to run in reasonable time. Using thresholds higher than program to run in reasonable time. Using thresholds higher than
necessary could potentially cause system-wide memory pressure, and necessary could potentially cause higher system-wide memory pressure,
should therefore be avoided. and should therefore be avoided.
You can make collections more frequent by specifying a smaller value, down You can make collections more frequent by specifying a smaller value, down
to 1/10th of @code{GC_DEFAULT_THRESHOLD}. A value less than this minimum to 1/10th of @code{GC_DEFAULT_THRESHOLD}. A value less than this minimum