SWI-Prolog has a number of memory areas which are not enlarged at run
time, unless you have a version with dynamic stack allocation. The
default sizes for these areas should suffice for small applications, but
most serious application require larger ones. They all can be modified
by command line options. The table below shows these areas. The first
column gives the option name to modify the size of the area. This
option character should be followed immediately by a number and
expresses the number of kilo bytes to use for the area. There are no
other limits than the available memory of the machine to the sizes of
the areas. The areas are described in table .
The heap is a memory area to store atoms, clauses, records, flags, etc.
This area is dynamically enlarged at runtime on all versions of SWI-Prolog.
Table:
Memory areas
Option |
Default1 |
Area name |
Description |
-L |
200K (2M) |
local stack |
The local stack is used to store
the execution environments of procedure
invocations. The space for an environment is
reclaimed when it fails, exits without leaving
choice points, the alternatives are cut of with
the ! predicate or no choice points have
been created since the invocation and the last
subclause is started (tail recursion optimisation). |
-G |
100K (4M) |
global stack |
The global stack is used
to store terms created during Prolog's
execution. Terms on this stack will be reclaimed
by backtracking to a point before the term
was created or by garbage collection (provided the
term is no longer referenced). |
-T |
50K (4M) |
trail stack |
The trail stack is used to store
assignments during execution. Entries on this
stack remain alive until backtracking before the
point of creation or the garbage collector
determines they are nor needed any longer. |
-A |
5K (1M) |
argument stack |
The argument stack is used to
store one of the intermediate code interpreter's
registers. The amount of space needed on this
stack is determined entirely by the depth in
which terms are nested in the clauses that
constitute the program. Overflow is most likely
when using long strings in a clause. |
|
- Defaults may depend on local installation.
The value between brackets is the default limit for machines that allow
for dynamic stack allocation.
|
|