comparison src/share/vm/gc_interface/collectedHeap.cpp @ 615:c6c601a0f2d6

6797870: Add -XX:+{HeapDump,PrintClassHistogram}{Before,After}FullGC Summary: 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
author ysr
date Mon, 02 Mar 2009 16:37:04 -0800
parents d593294016c3
children 7bb995fbd3c0
comparison
equal deleted inserted replaced
598:1fa16c3565be 615:c6c601a0f2d6
292 "should only resize tlabs at safepoint"); 292 "should only resize tlabs at safepoint");
293 293
294 ThreadLocalAllocBuffer::resize_all_tlabs(); 294 ThreadLocalAllocBuffer::resize_all_tlabs();
295 } 295 }
296 } 296 }
297
298 void CollectedHeap::pre_full_gc_dump() {
299 if (HeapDumpBeforeFullGC) {
300 TraceTime tt("Heap Dump: ", PrintGCDetails, false, gclog_or_tty);
301 // We are doing a "major" collection and a heap dump before
302 // major collection has been requested.
303 HeapDumper::dump_heap();
304 }
305 if (PrintClassHistogramBeforeFullGC) {
306 TraceTime tt("Class Histogram: ", PrintGCDetails, true, gclog_or_tty);
307 VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */, false /* ! prologue */);
308 inspector.doit();
309 }
310 }
311
312 void CollectedHeap::post_full_gc_dump() {
313 if (HeapDumpAfterFullGC) {
314 TraceTime tt("Heap Dump", PrintGCDetails, false, gclog_or_tty);
315 HeapDumper::dump_heap();
316 }
317 if (PrintClassHistogramAfterFullGC) {
318 TraceTime tt("Class Histogram", PrintGCDetails, true, gclog_or_tty);
319 VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */, false /* ! prologue */);
320 inspector.doit();
321 }
322 }