The user has the option of executing programs with or without garbage
collection. Procedures that don’t use a large amount of heap space
before backtracking may not be affected when garbage collection is
enabled. Procedures that do use a large amount of heap space may
execute more slowly due to the time spent garbage collecting, but will
be more likely to run to completion. On the other hand, such programs
may run faster when the garbage collector is enabled because the
virtual memory is not expanded to the extent that “thrashing”
occurs. The gc
Prolog flag can be set to on
or
off
. To monitor garbage collections in verbose mode, set the
gc_trace
flag to verbose
. By default, garbage
collection is enabled.