5.4 Controlling memory expansion
5.4.2 Explicitly expanding memory
You can explicitly expand the following areas in memory:- You can expand the reserved area by calling the function
change-memory-management
with the value of the:expand-reserved
keyword argument set to the desired size in segments. - You can expand the dynamic semi-spaces by calling the function
change-memory-management
with the value of the:expand
keyword argument set to the desired size in segments.
When you are expanding memory, consider the following information:- Increasing the size of the reserved area allows you to load large amounts of code into the image or create many foreign data structures without performing as many garbage collections as Lisp would while automatically expanding the area. Increasing the reserved area, however, increases the amount of memory required to start the image and might increase the size of a saved image.
- Lisp can expand memory to the size allowed by the Memory Growth Limit parameter only if that amount is available from the operating system. If Lisp cannot expand memory as requested, memory is simply not expanded; no error is signaled.
- You can customize an image by specifying the desired amount of storage in the reserved and dynamic areas when you call the function
disksave
or by calling the functionchange-memory-management
in an initialization file. See Chapter 2, "Customizing the Lisp Environment" in The Advanced User's Guide for information about the functiondisksave
and about initialization files.
If a garbage collection does not reclaim enough room to continue a computation and memory cannot be expanded, garbage collection is disabled, an error is signaled, and the Debugger is entered. You then have two options:- You can return to the top level by typing the Debugger command
:a
. You must then explicitly enable both dynamic and ephemeral garbage collection. - You can continue creating objects in the area normally reserved for copying by typing the Debugger command
:c
.
Note: Use caution if you continue consing while garbage collection is disabled; if your program fills the dynamic space, further garbage collection is impossible and your program will run out of memory.
The User's Guide - 9 SEP 1996 Generated with Harlequin WebMaker