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

set-split-promotion Function


Mobile GC only: Sets splitting promotion of generation 1.




set-split-promotion on-p => prev-on-p

A boolean.
A boolean.

The function set-split-promotion switches split promotion of generation 1 on or off, depending of the value of on-p. Split promotion means that in a copying (the default) GC, objects in generation 1 that already survived a GC of generation 1 are promoted to generation 2, while objects that are new in generation 1 stay in generation 1. Non-split promotion means that all objects in generation 1 are promoted to generation 2.

Split promotion makes it less likely that objects will reach generation 2 and then die (causing a "generation leak"), but means that the GC spends more time on long-lived objects in generation 1 that should be in generation 2. Since "generation leak" is the more serious problem, the default is on, and it is probably rarely useful to switch it off.

A situation when it is useful to switch it off is when you have an "initialization" phase when you allocate mostly long-lived objects, and explicitly invoke a GC of generation 2 at the end of this phase. In this situation, you are not worried about generation leak, because all the leaked objects will be discarded when you invoke the GC of generation 2, so switching off split promotion during the phase may speed it up. However the effect is unlikely to be large, and you should time the initialization phase with and without split promotion to see which is faster.

set-split-promotion returns the previous setting.

See also

11.5.2 Mobile GC technical details

LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:31:02