Next: , Previous: , Up: Design Choices and Extensions   [Contents][Index]

2.7 Garbage Collection

CMUCL uses either a stop-and-copy garbage collector or a generational, mostly copying garbage collector. Which collector is available depends on the platform and the features of the platform. The stop-and-copy GC is available on all RISC platforms. The x86 platform supports a conservative stop-and-copy collector, which is now rarely used, and a generational conservative collector. On the Sparc platform, both the stop-and-copy GC and the generational GC are available, but the stop-and-copy GC is deprecated in favor of the generational GC.

The generational GC is available if *features* contains :gencgc.

The following functions invoke the garbage collector or control whether automatic garbage collection is in effect:

Function: extensions:gc &optional verbose-p

This function runs the garbage collector. If ext:*gc-verbose* is non-nil, then it invokes ext:*gc-notify-before* before GC’ing and ext:*gc-notify-after* afterwards.

verbose-p indicates whether GC statistics are printed or not.

Function: extensions:gc-off

This function inhibits automatic garbage collection. After calling it, the system will not GC unless you call ext:gc or ext:gc-on.

Function: extensions:gc-on

This function reinstates automatic garbage collection. If the system would have GC’ed while automatic GC was inhibited, then this will call ext:gc.