Monitoring garbage collection

A verbosegc trace prints garbage collection actions and statistics to stderr. The verbosegc trace is activated by using the Java run time option of -verbose:gc. Output from -verbose:gc is different for the Sun HotSpot and IBM JVMs. Below are sample output from a verbosegc trace with embedded explanations of key pieces of information for both an IBM JVM and Sun HotSpot.

IBM JVM -verbose:gc output

<AF[8]: Allocation Failure. need 1572744 bytes <-amount of memory requested, 5875 ms since last AF> <AF[8]: managing allocation failure, action=1 (23393256 <-free at alloc failure)/131070968 <- heapsize) (2096880/3145728)> <GC: Tue Dec 18 17:32:26 2001 <GC(12): freed 75350432 bytes in 168 ms <- duration of GC, 75% free (100840568 <-free)/134216696 <- total heapsize)> <GC(12): mark: 129 ms, sweep: 39 ms, compact: 0 ms <-compact did not run> <GC(12): refs: soft 0 (age >= 32), weak 0, final 0 <-no finalizers, phantom 0> <AF[8]: completed in 203 ms>

SUN JVM -verbosgc (young and old)

[GC 325816K->83372K(776768K), 0.2454258 secs <-duration of GC] [Full GC 267628K->83769K <- live data (776768K <-size of heap), 1.8479984 secs]

Copyright IBM Corp. 1997, 2003