The memory management counters are returned in a stat record. The total amount of memory allocated by the program since it was started is (in words) minor_words + major_words - promoted_words. Multiply by the word size (4 on a 32-bit machine, 8 on a 64-bit machine) to get the number of bytes.

Fields

top_heap_words:Int

Maximum size reached by the major heap, in words.

stack_size:Int

Current size of the stack, in words.

promoted_words:Float

Number of words allocated in the minor heap that survived a minor collection and were moved to the major heap since the program was started.

minor_words:Float

Number of words allocated in the minor heap since the program was started. This number is accurate in byte-code programs, but only an approximation in programs compiled to native code.

minor_collections:Float

Number of minor collections since the program was started.

major_words:Float

Number of words allocated in the major heap, including the promoted words, since the program was started.

major_collections:Float

Number of major collection cycles completed since the program was started.

live_words:Int

Number of words of live data in the major heap, including the header words.

live_blocks:Int

Number of live blocks in the major heap.

largest_free:Int

Size (in words) of the largest block in the free list.

heap_words:Int

Total size of the major heap, in words.

heap_chunks:Int

Number of contiguous pieces of memory that make up the major heap.

free_words:Int

Number of words in the free list.

free_blocks:Int

Number of blocks in the free list.

fragments:Int

Number of wasted words due to fragmentation. These are 1-words free blocks placed between two live blocks. They are not available for allocation.

compactions:Int

Number of heap compactions since the program was started.