Macaulay2 » Documentation
Packages » Macaulay2Doc :: GCstats
next | previous | forward | backward | up | index | toc

GCstats -- information about the status of the garbage collector

Description

Macaulay2 uses the Hans Boehm garbage collector to reclaim unused memory. The function GCstats provides information about its status, such as the total number of bytes allocated, the current heap size, the number of garbage collections done, the number of threads used in each collection, the total cpu time spent in garbage collection, etc.

i1 : s = GCstats()

o1 = HashTable{"bytesAlloc" => 11651885578        }
               "GC_free_space_divisor" => 3
               "GC_LARGE_ALLOC_WARN_INTERVAL" => 1
               "gcCpuTimeSecs" => 0
               "heapSize" => 222101504
               "numGCs" => 797
               "numGCThreads" => 12

o1 : HashTable

The value returned is a hash table, from which individual bits of information can be easily extracted, as follows.

i2 : s#"heapSize"

o2 = 222101504

Any entries whose keys are all upper case give the values of environment variables affecting the operation of the garbage collector that have been specified by the user.

For further information about the individual items in the table, we refer the user to the source code and documentation of the garbage collector.

See also

For the programmer

The object GCstats is a compiled function.