summaryrefslogtreecommitdiff
path: root/doc/lispref/internals.texi
diff options
context:
space:
mode:
authorTassilo Horn <tsdh@gnu.org>2019-09-22 11:02:39 +0200
committerTassilo Horn <tsdh@gnu.org>2019-09-22 11:02:39 +0200
commitaf0642a4cb220f33a43d1380be085bc0b7134bb8 (patch)
treee3b1b57bc42e712c77bd55fc4fc722cf93fe6c66 /doc/lispref/internals.texi
parent8992bc7d1b7e7babbf2899b5c45e84b486f504e6 (diff)
parent37a4233a366797360c2f4f475591a3406586bcfb (diff)
downloademacs-scratch/tsdh-vc-list-files.tar.gz
Merge remote-tracking branch 'origin/master' into scratch/tsdh-vc-list-filesscratch/tsdh-vc-list-files
Diffstat (limited to 'doc/lispref/internals.texi')
-rw-r--r--doc/lispref/internals.texi13
1 files changed, 10 insertions, 3 deletions
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index f85c266edef..c52999e1cd2 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -533,9 +533,6 @@ be allocated for Lisp objects after one garbage collection in order to
trigger another garbage collection. You can use the result returned by
@code{garbage-collect} to get an information about size of the particular
object type; space allocated to the contents of buffers does not count.
-Note that the subsequent garbage collection does not happen immediately
-when the threshold is exhausted, but only the next time the Lisp interpreter
-is called.
The initial threshold value is @code{GC_DEFAULT_THRESHOLD}, defined in
@file{alloc.c}. Since it's defined in @code{word_size} units, the value
@@ -562,6 +559,16 @@ increases. Thus, it can be desirable to do them less frequently in
proportion.
@end defopt
+ Control over the garbage collector via @code{gc-cons-threshold} and
+@code{gc-cons-percentage} is only approximate. Although Emacs checks
+for threshold exhaustion regularly, for efficiency reasons it does not
+do so immediately after every change to the heap or to
+@code{gc-cons-threshold} or @code{gc-cons-percentage}, so exhausting
+the threshold does not immediately trigger garbage collection. Also,
+for efficency in threshold calculations Emacs approximates the heap
+size, which counts the bytes used by currently-accessible objects in
+the heap.
+
The value returned by @code{garbage-collect} describes the amount of
memory used by Lisp data, broken down by data type. By contrast, the
function @code{memory-limit} provides information on the total amount of