All Manuals > LispWorks User Guide and Reference Manual > 49 The SYSTEM Package

NextPrevUpTopContentsIndex

set-gen-num-gc-threshold

Function
Summary

Sets the additional allocation threshold that triggers a GC in the blocking generation in 64-bit LispWorks.

Package

system

Signature

set-gen-num-gc-threshold gen-num threshold => old-threshold

Arguments

gen-num

An integer between 0 and 7, inclusive.

threshold

An integer greater than 12800, or a real in the inclusive range [0 100], or nil.

Values

old-threshold

A number.

Description

The function set-gen-num-gc-threshold sets the threshold for additional allocation that triggers a garbage collection (GC) in generation gen-num when this is the blocking generation (as set by set-blocking-gen-num). A GC is triggered when the allocation in generation gen-num grows more than threshold over the allocation after the last GC of this generation (or a GC of a higher generation).

To set the threshold, threshold can be an integer greater than 12800, which is interpreted as the absolute value. Alternatively threshold can be a real number in the inclusive range [0 100], which is multiplied by the allocation since the previous GC to get the actual threshold to set.

The default threshold for all generations is 1. That is, for all generations gen-num, when generation gen-num is the blocking generation and allocation in it has doubled since the previous GC, generation gen-num is collected automatically.

set-gen-num-gc-threshold can be called when the generation gen-num is not the blocking generation, and will set the value for that gen-num. Such a call will not take effect until the generation gen-num becomes the blocking generation, as set by a call to set-blocking-gen-num (with :do-gc non-nil).

Increasing the threshold reduces the number of GC calls, but may increase the virtual memory usage.

set-gen-num-gc-threshold returns the old threshold for the generation gen-num. It can be called with threshold nil to return the threshold value without changing it.

Notes

set-gen-num-gc-threshold is implemented only in 64-bit LispWorks. It is not relevant to the Memory Management API in 32-bit implementations.

See also

set-blocking-gen-num
Memory Management in 64-bit LispWorks


LispWorks User Guide and Reference Manual - 13 Feb 2015

NextPrevUpTopContentsIndex