Note: limit_stack/2 and trim_stacks/0 have no effect on machines that do not offer dynamic stack expansion. On these machines these predicates simply succeed to improve portability.
agc_margin (a 
prolog flag) atoms have been created. On multi-threaded versions the 
actual collection is delayed until there there are no threads performing 
normal garbage collection. In this case garbage_collect_atoms/0 
returns immediately. Note this implies there is no guarantee it will ever 
happen as there may always be threads performing garbage collection.
local, global or trail. The limit 
is an integer, expressing the desired stack limit in K bytes. If the 
desired limit is smaller than the currently used value, the limit is set 
to the nearest legal value above the currently used value. If the 
desired value is larger than the maximum, the maximum is taken. Finally, 
if the desired value is either 0 or the atom unlimited the 
limit is set to its maximum. The maximum and initial limit is determined 
by the command line options -L, -G and -T.
loop :-
        generator,
            trim_stacks,
            potentially_expensive_operation,
        stop_condition, !.
 | 
The prolog top level loop is written this way, reclaiming memory resources after every user query.
local, global, trail 
or argument. The table below describes the Key/Value 
pairs. Old is first unified with the current value.
limit  | Maximum size of the stack in bytes | 
min_free  | Minimum free space at entry of foreign predicate | 
This predicate is currently only available on versions that use the stack-shifter to enlarge the runtime stacks when necessary. It's definition is subject to change.