Scieneer Common Lisp 1.3.9 online documentation

ext:generation-expected-survival-rate generation[Function]

Return the percentange of objects expected to survive garbage collection of the generation. The garbage collector uses this expected survival rate to estimate the memory required to perform the garbage collection and inhibits garbage collection if there is there is not be enough memory. During garbage collection, reachable objects are copied and this requires extra memory for the new copies - in the worst case the total memory required is twice the current amount of memory used by the generation. The percentage is the total number of bytes expected to be allocated to the generation after garbage collection divided by the number before garbage collection.

(setf (ext:generation-expected-survival-rate generation) rate)[Function]

Set the percentange of objects expected to survive garbage collection of the generation. Setting the percentage to zero prevents the garbage collector being inhibited and this is the default for all generations. This parameter is saved in a lisp core file and is in effect when restarted.

Setting this parameter to a non-zero value may allow an application to complete a computation without the risk of a large garbage collection exhausting available memory. While garbage collection of the generation is inhibited, younger objects will continue to be promoted into the generation and garbage will not be collected which will eventually cause the process to run out of memory. If an application has a large permanent heap then consider locking this into an older generation, see ext:oldest-generation-to-gc.