5.3.1 The Dynamic Garbage Collector

5.3.1.1 Disabling dynamic garbage collection

You should avoid disabling dynamic garbage collection whenever possible. Disabling dynamic garbage collection can make future garbage collection impossible because all memory normally allocated for the dynamic semi-spaces is used for creating objects; if garbage collection is later enabled, there might not be enough room in which to copy the retained objects. If the dynamic semi-spaces become full when dynamic garbage collection is disabled, Lisp halts irrevocably. Note that disabling dynamic garbage collection also disables ephemeral garbage collection.

The following functions enable and disable dynamic garbage collection:

gc-off
gc-on

The function gc-off disables dynamic garbage collection. When dynamic garbage collection is disabled, Lisp records the remaining amount of free storage. Each time 50 percent of the remaining space has been consumed, the Dynamic Garbage Collector asks whether you want to reconsider and enable it. To turn off this periodic querying, specify a non-nil value for the optional no-reconsideration argument togc-off.

The function gc-on enables dynamic garbage collection. Note that you must explicitly enable garbage collection if Lisp has turned off garbage collection in an attempt to create more storage space during a computation.


The User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker