Extracted from Pike v7.6 release 61 at 2005-12-30.
pike.ida.liu.se
[Top]
Pike

Method Pike.gc_parameters()


Method gc_parameters

mapping(string:float) Pike.gc_parameters(void|mapping(string:mixed) params)

Description

Set and get various parameters that control the operation of the garbage collector. The passed mapping contains the parameters to set. If a parameter is missing from the mapping, the current value will be filled in instead. The same mapping is returned. Thus an empty mapping, or no argument at all, causes a mapping with all current settings to be returned.

The following parameters are recognized:

"enabled" : int

If this is 1 then the gc is enabled as usual. If it's 0 then all automatically scheduled gc runs are disabled and the parameters below have no effect, but explicit runs through the gc function still works as usual. If it's -1 then the gc is completely disabled so that even explicit gc calls won't do anything.

"garbage_ratio_low" : float

As long as the gc time is less than gc_time_ratio, aim to run the gc approximately every time the ratio between the garbage and the total amount of allocated things is this.

"time_ratio" : float

When more than this fraction of the cpu time is spent in the gc, aim for gc_garbage_ratio_high instead of gc_garbage_ratio_low.

"garbage_ratio_high" : float

Upper limit for the garbage ratio - run the gc as often as it takes to keep it below this.

"average_slowness" : float

When predicting the next gc interval, use a decaying average with this slowness factor. It should be a value between 0.0 and 1.0 that specifies the weight to give to the old average value. The remaining weight up to 1.0 is given to the last reading.


See also

gc , Debug.gc_status