mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
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:
parent
dd4aaeadd4
commit
72bfacbd95
15 changed files with 170 additions and 62 deletions
|
@ -294,3 +294,29 @@ void CollectedHeap::resize_all_tlabs() {
|
|||
ThreadLocalAllocBuffer::resize_all_tlabs();
|
||||
}
|
||||
}
|
||||
|
||||
void CollectedHeap::pre_full_gc_dump() {
|
||||
if (HeapDumpBeforeFullGC) {
|
||||
TraceTime tt("Heap Dump: ", PrintGCDetails, false, gclog_or_tty);
|
||||
// We are doing a "major" collection and a heap dump before
|
||||
// major collection has been requested.
|
||||
HeapDumper::dump_heap();
|
||||
}
|
||||
if (PrintClassHistogramBeforeFullGC) {
|
||||
TraceTime tt("Class Histogram: ", PrintGCDetails, true, gclog_or_tty);
|
||||
VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */, false /* ! prologue */);
|
||||
inspector.doit();
|
||||
}
|
||||
}
|
||||
|
||||
void CollectedHeap::post_full_gc_dump() {
|
||||
if (HeapDumpAfterFullGC) {
|
||||
TraceTime tt("Heap Dump", PrintGCDetails, false, gclog_or_tty);
|
||||
HeapDumper::dump_heap();
|
||||
}
|
||||
if (PrintClassHistogramAfterFullGC) {
|
||||
TraceTime tt("Class Histogram", PrintGCDetails, true, gclog_or_tty);
|
||||
VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */, false /* ! prologue */);
|
||||
inspector.doit();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue