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
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.
major_words:Float
Number of words allocated in the major heap, including the promoted words, since the program was started.