Search                        Top                                  Index
HELP SYSGARBAGE                                     Steve Hardy Mar 1982
                                               Updated A.Sloman Apr 1989
                                         Updated: Adrian Howard Mar 1992


This procedure causes a garbage collection (GC). Normally garbage
collections are invoked by the store manager when an attempt is made to
create a new structure (or compile a procedure) and there is not enough
free space at the end of the heap. The procedure -sysgarbage- is useful
if you wish to ensure that as much space is available as possible before
a particular program starts running.

For a tutorial explanation of what garbage collection is see TEACH *GC.

There are two kinds of garbage collectors provided in POPLOG, a copying
version (the default on most machines) which is usually faster if you
have lots of memory available, and a non-copying version which is
automatically invoked if no space is available for the copying. The type
of garbage collector used is controlled by the variable -pop_gc_copy-
(see REF *POP_GC_COPY for details.)

The user definable procedure -pop_after_gc- (default -identfn-) is run
after every garbage collection.

It is also possible for the user to specify "destroy actions" which get
executed when a data-structure is about to become garbage collected. See
the section 'Destroy Properties' in REF *PROPS for details.

For full information about store management and mechanisms for
controlling it see the section titled 'Store Management' in REF *SYSTEM.

Also see:

    *POPGCTRACE    --- Tracing GCs
    *POPGCTIME     --- Getting the time spent garbage collecting
    *POPGCRATIO    --- Controlling when garbage collection occurs
    *EFFICIENCY    --- General advice on efficiency
    *POPMEMLIM     --- On setting the maximum memory size
    *POPMEMUSED    --- The memory used at the last GC
    *SYS_LOCK_HEAP --- How to "lock" the heap to reduce GC times

--- C.all/help/sysgarbage
--- Copyright University of Sussex 1992. All rights reserved. ----------