in time based stat like, gen0(s) count is total number of collection, total is total number of seconds mean is total/count (an avg number of secs each collection took) max is max secs a collection took stddev secs stddev

for size based stats like, alloc(MB)
count is number of allocations
total is total MB allocation
mean total/count (avg allocation size is each allocation)
max max size a allocation did
stddev size stddev

# Number of cpus. Require this on the command line since defaulting to 1 is # too error prone. Older versions used ncpu as the var name; accept it for # compatibility. if (cpus == 0) cpus = ncpu; if (cpus == 0 && plot == “”) { print usage_msg; exit(1); }

# A note on time stamps: the firstTimeStamp is not always assumed to be 0 so # that we can get accurate elapsed time measurement for a partial log (e.g., # from the steady-state portion of a log from a long running server). This # means that the elapsed time measurement can be wrong if a program runs for a # significant amount of time before the first gc time stamp is reported. The # best way to fix this is to have the VM emit a time stamp when heap # initialization is complete. firstTimeStamp = -1.0; # sentinel prevTimeStamp = lastTimeStamp = firstTimeStamp;

lastFileName = “”; # Used to detect when the input file has changed.

# This value is added to time stamps so that input from multiple files appears # to have monotonically increasing timestamps. timeStampOffset = 0.0;

function getTimeStamp() { gts_tmp_str = $0; # Note: want to match the time stamp just before the ‘[GC’ or ‘[Full GC’ or # ‘[CMS-‘ string on the line, and there may be time stamps that appear # earlier. Thus there is no beginning-of-line anchor (‘^’) in the regexp used # with match(). if (sub(/:? ? ?[((Full )?GC|(AS)?CMS-).*/, “”, gts_tmp_str) != 1) return -1.0; if (! match(gts_tmp_str, “[0-9]+\.[0-9]+(e[+-][0-9]+)?$”)) return -1.0;

# Match CMS initial mark or remark output from -verbose:gc.## [GC 43466K(68920K), 0.0002577 secs]match($0, “\[GC ” cms_heap_report_re “\]”) { match($0, gc_time_secs_re); secs = substr($0, RSTART, RLENGTH – 5) + 0; recordStats(gen1t_idx, secs); # XXX – this updates the count of gen1 collections for both initial mark and # remark. Would like to update it only once per cms cycle (i.e., for initial # mark only). Doing the increment every other time would be more accurate, # but still subject to error because of aborted CMS cycles. next;}

# The second time is the total time, which includes prologue, epilogue and # safepoint time. match(tString, gc_time_secs_re); secs = substr(tString, RSTART, RLENGTH – 5) + 0; recordStats(gen0t_idx, secs);