!=preamble "GC statistics" ?>
!=navbar "/gc" ?>
^open Gc open Buffer
let interval = 3 let delim = ","
let fmt s =
let n = String.length s in
let buf = create (n*2) in add_string buf "";
let i = ref((n-1) mod interval + 1) in
add_string buf (String.sub s 0 (!i));
while !i < n do
add_string buf delim;
add_string buf (String.sub s (!i) interval);
i := !i + interval
done;
add_string buf "";
contents buf
let i n = fmt (string_of_int n)
let f m = fmt (Printf.sprintf "%.0f" m) ?>
Garbage collector statistics
- minor words: =f st.minor_words ?>
- 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.
- promoted words: =f st.promoted_words ?>
- 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.
- major words: =f st.major_words ?>
- Number of words allocated in the major heap, including
the promoted words, since the program was started.
- minor collections: =i st.minor_collections ?>
- Number of minor collections since the program was started.
- major collections: =i st.major_collections ?>
- Number of major collection cycles completed since the program
was started.
- heap words: =i st.heap_words ?>
- Total size of the major heap, in words.
- heap chunks: =i st.heap_chunks ?>
- Number of contiguous pieces of memory that make up the major heap.
- live words: =i st.live_words ?>
- Number of words of live data in the major heap, including the header
words.
- live blocks: =i st.live_blocks ?>
- Number of live blocks in the major heap.
- free words: =i st.free_words ?>
- Number of words in the free list.
- free blocks: =i st.free_blocks ?>
- Number of blocks in the free list.
- largest free: =i st.largest_free ?>
- Size (in words) of the largest block in the free list.
- fragments: =i st.fragments ?>
- 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: =i st.compactions ?>
- Number of heap compactions since the program was started.
- top heap words: =i st.top_heap_words ?>
- Maximum size reached by the major heap, in words.
=postamble?>