Go to the first, previous, next, last section, table of contents.

Garbage Collection

This section describes procedures that control garbage collection. See see section Customizing Scheme for a discussion of how MIT Scheme uses memory.

procedure+: gc-flip [safety-margin]
Forces a garbage collection to occur. Returns the number of words of available storage after collection.

Safety-margin determines the number of words of storage available for system tasks in-between detecting the need for a garbage collection and entering the garbage collector proper. An example of such a system task is changing the run-light to show `gc' when scheme is running under Emacs.

procedure+: set-gc-notification! on?
Controls whether the user is notified of garbage collections. If on? is #F, the user is not notified, otherwise the user is notified. The default is no notification.

The notification appears as a single line like the following, showing how many garbage collections have occured, the time taken to perform the garbage collection and the free storage remaining (in words) after collection.

GC 5: took:   0.50   (8%) CPU time,   0.70   (2%) real time; free: 364346

To operate comfortably, the amount of free storage after garbage collection should be a substantial proportion of the heap size. If the percentage CPU time is consistently high (over 20%), you should consider running with a larger heap. A rough rule of thumb to halve the GC overhead is to take the amount of free storage, divide by 1000, and add this figure to the current value used for the `-heap' command line option. Unfortunately there is no way to adjust the heap size without restarting Scheme.

purify: item [pure-space? [queue?]]
flush-purification-queue!:
** We should say something about these **


Go to the first, previous, next, last section, table of contents.