35.7. Forcing or inhibiting Garbage Collections

Here are some tips to debug garbage-collection-related problems.

It is possible to force garbage-collections to occur at specific points, by inserting calls to EXT:GC in the code.

It is also possible to make garbage-collections more frequent overall, by use of the command-line option -nextgc-factor. This option specifies a factor that gets applied to the amount of space that can be consumed before the next garbage-collection is triggered. If you specify a factor smaller than 1, the frequency of garbage-collections is increased. For example, -nextgc-factor 0.001 reduces the "Bytes available until next GC" value displayed by the ROOM function by a factor of 1000, and thus makes garbage-collections 1000 times more frequent.

It is equally possible to make garbage-collections less frequent. To this effect, you pass to -nextgc-factor a value larger than 1. For example, -nextgc-factor 1e9 multiplies the "Bytes available until next GC" value displayed by the ROOM function with a factor of 1000000000, and thus effectively inhibits garbage-collections entirely.


These notes document CLISP version 2.49.93+Last modified: 2018-02-19