Function | Package: system | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Object described on page has changed in 10.1. 10.0 version

## resize-areas

Arguments: &key old old-symbols new global-gc tenure expand sift-old-areas pack-heap verbose

This function attempts to restructure the Lisp heap according to the programmer's wishes. These wishes may call for old or new space to be increased in size (usually doable unless the operating system refuses to give up the needed extra space) or to be reduced in size (sometimes doable, but gaps -- foreign data -- above newspace or between the top oldspace and newspace may prevent resizing). Note that other gsgc parameters or requirements may also prevent resizing. This function can modify newspace, the top oldspace, and can coalesce two or more adjacent oldspace areas into one. Arguments control whether a global gc and/or tenuring of objects in newspace are forced prior to resizing.

As a general rule, you should not call this function as part of the actions of the `*gc-after-hook*`. Doing so carelessly can cause Lisp to fail. See `*gc-after-hook*` for more discussion about this issue.

Be careful if you call resize-areas more than once: if :pack-heap is true (the default), the system will reduce the sizes of areas (old, new) which are not specified if possible and that may not be what you want. So

    (resize-areas :old 8000000000)
    (resize-areas :new 4000000000) ;; This signals a warning

The second call reduces the size of old space, and undoes the first call. Because calling sys:resize-areas without a value specified for the old keyword argument reduces the available space in the old area to a minimum (which is rarely what is desired), a warning is signaled when old is not specified.

Argument | Values and effects
verbose | If non-nil (default nil), print information about what function is doing.
old new old-symbols (ignored) | For old and new arguments, the number of bytes which should be free in that area (oldspace and newspace) after this function returns. Other gsgc parameters may affect the number of free bytes, so the values specified are lower limits. The newspace value applies to the free space in the half of newspace that is currently used. old-symbols is ignored (it is kept for backward compatibility only). old defaults to 0. Be careful if you call resize-areas with pack-heap true (the default) and old unspecified: old space will be shrunk as much as possible which may not be what you want. Because calling sys:resize-areas without a value specified for the old keyword argument reduces the available space in the old area to a minimum, a warning is signaled when old is not specified. new defaults to `(+ (``gsgc-parameter``:free-bytes-new-pages) (sys:gsgc-parameter :free-bytes-new-other)))`
global-gc | If true, do a global gc before other actions. Defaults to `nil` but note that a (perhaps second) global gc is also done later if sift-old-areas and pack-heap are both `t`.
tenure | If true then tenure all possible data in newspace after processing the global-gc keyword argument but before any other keyword values. Defaults to `nil`.
expand | If true then expand oldspace or symbol oldspace if necessary, otherwise do nothing if the requested amount is not free. Defaults to `t`.
sift-old-areas | Move data in oldspace down to the oldest oldspace area possible. The hope is that the lower (older) oldspace areas will fill up, leaving the higher (newer) areas empty (or emptier). If both this argument and pack-heap are true, a global gc will occur after sifting and then adjacent empty oldspace areas will be coalesced if possible. Defaults to `t`. The global gc that occurs if this argument and pack-heap are both true can take an appreciable time so make this argument `nil` when time is an issue.
pack-heap | Reduce the size of the top (newest) old area as much as possible. Defaults to `t`.

See gc.htm for more information on garbage collection and gsgc parameters.

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
The object described on this page has been modified in the 10.1 release; see the Release Notes.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Object described on page has changed in 10.1. 10.0 version