提交 6beb97f2 编写于 作者: Y ysr

6810861: G1: support -XX:+{PrintClassHistogram,HeapDump}{Before,After}FullGC

Summary: Call {pre,post}_full_gc_dump() before and after a STW full gc of G1CollectedHeap. Also adjusted the prefix message, including the addition of missing whitespace.
Reviewed-by: brutisso, tonyp
上级 0eadea79
......@@ -1227,6 +1227,7 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
/* option */ VerifyOption_G1UsePrevMarking);
}
pre_full_gc_dump();
COMPILER2_PRESENT(DerivedPointerTable::clear());
......@@ -1401,6 +1402,7 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
Universe::print_heap_after_gc();
}
g1mm()->update_counters();
post_full_gc_dump();
return true;
}
......
......@@ -404,13 +404,13 @@ void CollectedHeap::resize_all_tlabs() {
void CollectedHeap::pre_full_gc_dump() {
if (HeapDumpBeforeFullGC) {
TraceTime tt("Heap Dump: ", PrintGCDetails, false, gclog_or_tty);
TraceTime tt("Heap Dump (before full gc): ", 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);
TraceTime tt("Class Histogram (before full gc): ", PrintGCDetails, true, gclog_or_tty);
VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */, false /* ! prologue */);
inspector.doit();
}
......@@ -418,11 +418,11 @@ void CollectedHeap::pre_full_gc_dump() {
void CollectedHeap::post_full_gc_dump() {
if (HeapDumpAfterFullGC) {
TraceTime tt("Heap Dump", PrintGCDetails, false, gclog_or_tty);
TraceTime tt("Heap Dump (after full gc): ", PrintGCDetails, false, gclog_or_tty);
HeapDumper::dump_heap();
}
if (PrintClassHistogramAfterFullGC) {
TraceTime tt("Class Histogram", PrintGCDetails, true, gclog_or_tty);
TraceTime tt("Class Histogram (after full gc): ", PrintGCDetails, true, gclog_or_tty);
VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */, false /* ! prologue */);
inspector.doit();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册