6797870: Add -XX:+{HeapDump,PrintClassHistogram}{Before,After}FullGC

Call newly created CollectedHeap::dump_{pre,post}_full_gc before and after every stop-world full collection cycle on GenCollectedHeap and ParallelScavengeHeap. (Support for G1CollectedHeap forthcoming under CR 6810861.) Small modifications to existing heap dumping and class histogram implementation, especially to allow multiple on-the-fly histos/dumps by the VM thread during a single safepoint.

Reviewed-by: jmasa, alanb, mchung
This commit is contained in:
Y. Srinivas Ramakrishna 2009-03-02 16:37:04 -08:00
parent dd4aaeadd4
commit 72bfacbd95
15 changed files with 170 additions and 62 deletions

View file

@ -456,6 +456,9 @@ void GenCollectedHeap::do_collection(bool full,
int max_level_collected = starting_level;
for (int i = starting_level; i <= max_level; i++) {
if (_gens[i]->should_collect(full, size, is_tlab)) {
if (i == n_gens() - 1) { // a major collection is to happen
pre_full_gc_dump(); // do any pre full gc dumps
}
// Timer for individual generations. Last argument is false: no CR
TraceTime t1(_gens[i]->short_name(), PrintGCDetails, false, gclog_or_tty);
TraceCollectorStats tcs(_gens[i]->counters());
@ -573,6 +576,10 @@ void GenCollectedHeap::do_collection(bool full,
// a whole heap collection.
complete = complete || (max_level_collected == n_gens() - 1);
if (complete) { // We did a "major" collection
post_full_gc_dump(); // do any post full gc dumps
}
if (PrintGCDetails) {
print_heap_change(gch_prev_used);