This module provides some execution statistics. The predicate statistics/2 returns some key figures of the memory management and the runtime system, whereas the predicate statistics/0 displays the key figures on the standard output. The measurement of the time perfor-mance of a goal is facilitated by the predicate time/1.Example:
Max Memory 512,753,664 Bytes
Used Memory 68,568,872 Bytes
Free Memory 444,184,792 Bytes
Uptime 5,293 Millis
GC Time 12 Millis
Thread Cpu Time 1,000 Millis
Current Time 02/13/18 15:20:08
Since Jekejeke Prolog is a multi-threaded interpreter, we also provide statistics for the threads in JVM known to the interpreter. The predicate thread_statistics/3 returns some key figures concerning the given thread, whereas the predicate threads/0 displays the key figures for all known threads on the standard output.Example:
Id Alive Clauses
21 Yes 0
25 Yes 1,256,856
The JVM will notify the Prolog interpreter about low memory. On the Android platform this is a suicide notice, since foreground heap compaction is not yet available and it is therefore recommended to exit the Prolog interpreter. On both the Swing and the Android platforms the thread statistics are then used to decide which thread will be aborted.
The following stats predicates are provided:
- max: The maximum memory in bytes.
- used: The currently used memory in bytes.
- free: The currently allocated but unused memory in bytes.
- uptime: The time since start-up in milliseconds.
- gctime: The time spent for garbage collection in milliseconds.
- time: The time spent by this Jekejeke Prolog thread.
- wall: The current time in milliseconds.
sys_thread_local_clauses: The number of thread local clauses.