aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2025-07-28 16:14:44 +0300
committerEli Zaretskii2025-07-28 16:14:44 +0300
commit8ec2ddebdd4ff92aa07a9a7a0881bd3e762acee3 (patch)
tree757e7ca33975d2a32fd572d42ec9ef8a296b132e
parent57a9798c22a6d8a75883dfcc1c4430be428d20bb (diff)
downloademacs-8ec2ddebdd4ff92aa07a9a7a0881bd3e762acee3.tar.gz
emacs-8ec2ddebdd4ff92aa07a9a7a0881bd3e762acee3.zip
; Update documentation of GC in ELisp manual
* doc/lispref/internals.texi (Garbage Collection): Update default values for GC-related thresholds. (Bug#79074)
-rw-r--r--doc/lispref/internals.texi25
1 files changed, 15 insertions, 10 deletions
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index cc82a03db98..939cd489241 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -555,16 +555,17 @@ object type; space allocated to the contents of buffers does not count.
555 555
556The initial threshold value is @code{GC_DEFAULT_THRESHOLD}, defined in 556The initial threshold value is @code{GC_DEFAULT_THRESHOLD}, defined in
557@file{alloc.c}. Since it's defined in @code{word_size} units, the 557@file{alloc.c}. Since it's defined in @code{word_size} units, the
558value is 400,000 for the default 32-bit configuration and 800,000 for 558value is 400,000 for the default 32-bit configuration, and 800,000 for
559the 64-bit one. If you specify a larger value, garbage collection 559the 64-bit one and for 32-bit builds configured with the
560will happen less often. This reduces the amount of time spent garbage 560@option{--with-wide-int} option. If you specify a larger value, garbage
561collecting (so Lisp programs will run faster between cycles of garbage 561collection will happen less often. This reduces the amount of time
562collection that happen more rarely), but increases total memory use. 562spent garbage collecting (so Lisp programs will run faster between
563You may want to do this when running a program that creates lots of 563cycles of garbage collection that happen more rarely), but increases
564Lisp data, especially if you need it to run faster. However, we 564total memory use. You may want to do this when running a program that
565recommend against increasing the threshold for prolonged periods of 565creates lots of Lisp data, especially if you need it to run faster.
566time, and advise that you never set it higher than needed for the 566However, we recommend against increasing the threshold for prolonged
567program to run in reasonable time. Using thresholds higher than 567periods of time, and advise that you never set it higher than needed for
568the program to run in reasonable time. Using thresholds higher than
568necessary could potentially cause higher system-wide memory pressure, 569necessary could potentially cause higher system-wide memory pressure,
569and also make each garbage-collection cycle take much more time, and 570and also make each garbage-collection cycle take much more time, and
570should therefore be avoided. 571should therefore be avoided.
@@ -585,6 +586,10 @@ As the heap size increases, the time to perform a garbage collection
585increases. Thus, it can be desirable to do them less frequently in 586increases. Thus, it can be desirable to do them less frequently in
586proportion. 587proportion.
587 588
589The initial percentage value is 0.1 in interactive sessions and while
590dumping Emacs (@pxref{Building Emacs}), and 1.0 in non-interactive
591(a.k.a.@: ``batch'') sessions.
592
588As with @code{gc-cons-threshold}, do not enlarge this more than 593As with @code{gc-cons-threshold}, do not enlarge this more than
589necessary, and never for prolonged periods of time. 594necessary, and never for prolonged periods of time.
590@end defopt 595@end defopt