LispWorks User Guide and Reference Manual > 40 The SYSTEM Package

NextPrevUpTopContentsIndex

set-maximum-segment-size

Function
Summary

Defines the maximum segment size for a generation and allocation type in 64-bit LispWorks.

Package

system

Signature

set-maximum-segment-size gen-num allocation-type size-in-mb

Arguments

gen-num

An integer between 0 and 7, inclusive.

allocation-type

One of :cons , :symbol , :function , :non-pointer , :other , :mixed , :cons-static , :non-pointer-static , :mixed-static , :weak , :other-big , and :non-pointer-big .

size-in-mb

An integer between 1 and 256 inclusive, or nil .

Values

max-segment-size

A number.

Description

The function set-maximum-segment-size sets the maximum segment size for a generation and allocation type in 64-bit LispWorks.

allocation-type can be any of the allocation types. However, if allocation-type is :other-big or :non-pointer-big , this function has no effect.

size-in-mb is the size in megabytes.

For the non-ephemeral generations (that is, the blocking generation and above), if the system needs more memory of some allocation type in some generation, its normal operation is to enlarge one of the existing segments in this generation of this allocation type. If it does not find a segment that it can enlarge, it allocates a new segment of the same allocation type in the same generation. Therefore the maximum segment size affects the number of segments that will be used.

There is an overhead to using more segments, so normally having the largest segment size which the implementation allows (256MB) is the best. Reducing the size may be useful when using marking-gc with what-to-copy non-nil or set-blocking-gen-num with do-gc a number to prevent fragmentation in the blocking generation. In this situation, reducing the size of each segment makes it easier for the system to find segments to copy, even if the max-size-to-copy parameter is set to a low number to avoid using too much virtual memory.

The returned value, max-segment-size , is the previous maximum segment size.

If size-in-mb is a number, it specifies the size in megabytes. If size-in-mb is nil then set-maximum-segment-size returns the maximum segment size without altering it.

Note: this function is implemented only in 64-bit LispWorks. It is not relevant to the Memory Management API in 32-bit implementations.

See also

marking-gc
set-blocking-gen-num
set-default-segment-size


LispWorks User Guide and Reference Manual - 22 Dec 2009

NextPrevUpTopContentsIndex