4.12 Time and Memory
Timings are available via the built-in predicates
To obtain the CPU time consumption of a (succeeding) goal, use the scheme
statistics/2 and statistics/0
commands can also be used to obtain memory usage information.
The memory areas used by ECLiPSe are:
TimeUsed is cputime-StartTime,
printf("Goal took %.2f seconds%n", [TimeUsed]).
Automatic garbage collection is done on the global and trail stack,
and on the dictionary. Garbage collection parameters can be set using
and an explicit collection can be requested using
Shared and private heap
- for compiled code, non-logical store (
bags and shelves, findall)
dictionary of functors, various tables and buffers.
- Global stack
- for most ECLiPSe data like lists, structures, suspensions.
This is likely to be the largest consumer of memory.
- Local stack
- for predicate call nesting and local variables.
- Control and trail stack
- for data needed on backtracking.