The function set-spare-keeping-policy
controls the behavior of the system when a segment is emptied in 64-bit LispWorks.
If policy is non-nil, then when a segment in generation gen-num is emptied by copying all the objects out from it, it may be kept as a spare segment to be used in the future. This increases the use of virtual memory, but reduces the number of calls to mmap
and munmap
. It may be useful in applications that allocate at a very high rate.
If timing an application reveals a lot (more than 5%) of time in the "System Time", and especially if this shows up in the GC times produced by extended-time, it may be useful to set the policy to non-nil in generation 1, 2 and maybe in generation 3.
The default policy is nil
for all generations, meaning that empty segments are discarded.
The returned value old-policy is the previous policy for the generation gen-num.
set-spare-keeping-policy
is implemented only in 64-bit LispWorks. It does nothing in the Mobile GC and its return value is not meaningful. It is not relevant to the Memory Management API in 32-bit implementations.
LispWorks User Guide and Reference Manual - 20 Sep 2017