Next: , Previous: , Up: Garbage Collection   [Contents][Index]


2.7.2 Generational GC

Generational GC also supports some additional functions and variables to control it.

Function: extensions:gc &key :verbose :gen :full

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

Print GC statistics if non-NIL.

gen

The number of generations to be collected.

full

If non-NIL, a full collection of all generations is performed.

Function: lisp::gencgc-stats generation

Returns statistics about the generation, as multiple values:

  1. Bytes allocated in this generation
  2. The GC trigger for this generation. When this many bytes have been allocated, a GC is started automatically.
  3. The number of bytes consed between GCs.
  4. The number of GCs that have been done on this generation. This is reset to zero when the generation is raised.
  5. The trigger age, which is the maximum number of GCs to perform before this generation is raised.
  6. The total number of bytes allocated to this generation.
  7. Average age of the objects in this generations. The average age is the cumulative bytes allocated divided by current number of bytes allocated.
Function: lisp::set-gc-trigger gen trigger

Sets the GC trigger value for the specified generation.

Function: lisp::set-trigger-age gen trigger-age

Sets the GC trigger age for the specified generation.

Function: lisp::set-min-mem-age gen min-mem-age

Sets the minimum average memory age for the specified generation. If the computed memory age is below this, GC is not performed, which helps prevent a GC when a large number of new live objects have been added in which case a GC would usually be a waste of time.


Next: Weak Pointers, Previous: GC Parameters, Up: Garbage Collection   [Contents][Index]