Frees memory and reduces the size of the image, if possible.
hcl
clean-down &optional full => new-size
full⇩ |
A generalized boolean. |
new-size |
A positive integer. |
The function clean-down
tries to free as much memory as possible and then reduce the size of the image as much as possible, and also move all the allocated objects to an old generation.
full controls whether to operate on the highest generation. The default value of full is t
.
If full is t
, clean-down
does a mark and sweep on generation 3, promotes all the objects into generation 3, deletes the empty segments and tries to reduce the image size. This is called by default before saving an image.
If full is nil
, clean-down
does a mark and sweep on generation 2, promotes all the objects to generation 2 and tries to reduce the size of all generations up to 2, but does not touch generation 3.
clean-down
returns the new size of the Lisp image after reduction, in bytes.
clean-down
may fail to delete empty segments if there are static segments in high address space.
clean-down
, though it does not do the mark and sweep.clean-down
is implemented as if by (gc-generation 7 :coalesce t)
though you can use gc-generation directly for better control.clean-down
performs the same GC as (gc-generation t)
.clean-down
may temporarily increase memory usage, and when called with full nil
may result in a larger Lisp image (though better organized, and therefore behaving better). In 32-bit LispWorks in situations where it is important not to increase memory usage, such as when the operating system signals that memory is low, use reduce-memory instead.
gc-generation
reduce-memory
save-image
try-move-in-generation
11.2 Guidance for control of the memory management system
LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:35