mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +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
|
@ -125,6 +125,8 @@ void PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) {
|
|||
perm_gen->verify_object_start_array();
|
||||
}
|
||||
|
||||
heap->pre_full_gc_dump();
|
||||
|
||||
// Filled in below to track the state of the young gen after the collection.
|
||||
bool eden_empty;
|
||||
bool survivors_empty;
|
||||
|
@ -363,6 +365,8 @@ void PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) {
|
|||
Universe::print_heap_after_gc();
|
||||
}
|
||||
|
||||
heap->post_full_gc_dump();
|
||||
|
||||
#ifdef TRACESPINNING
|
||||
ParallelTaskTerminator::print_termination_counts();
|
||||
#endif
|
||||
|
|
|
@ -1982,6 +1982,8 @@ void PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
|
|||
heap->record_gen_tops_before_GC();
|
||||
}
|
||||
|
||||
heap->pre_full_gc_dump();
|
||||
|
||||
_print_phases = PrintGCDetails && PrintParallelOldGCPhaseTimes;
|
||||
|
||||
// Make sure data structures are sane, make the heap parsable, and do other
|
||||
|
@ -2204,6 +2206,8 @@ void PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
|
|||
gc_task_manager()->print_task_time_stamps();
|
||||
}
|
||||
|
||||
heap->post_full_gc_dump();
|
||||
|
||||
#ifdef TRACESPINNING
|
||||
ParallelTaskTerminator::print_termination_counts();
|
||||
#endif
|
||||
|
|
|
@ -121,7 +121,7 @@ void VM_GC_HeapInspection::doit() {
|
|||
// make the heap parsable (no need to retire TLABs)
|
||||
ch->ensure_parsability(false);
|
||||
}
|
||||
HeapInspection::heap_inspection(_out);
|
||||
HeapInspection::heap_inspection(_out, _need_prologue /* need_prologue */);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -112,13 +112,16 @@ class VM_GC_HeapInspection: public VM_GC_Operation {
|
|||
private:
|
||||
outputStream* _out;
|
||||
bool _full_gc;
|
||||
bool _need_prologue;
|
||||
public:
|
||||
VM_GC_HeapInspection(outputStream* out, bool request_full_gc) :
|
||||
VM_GC_HeapInspection(outputStream* out, bool request_full_gc,
|
||||
bool need_prologue) :
|
||||
VM_GC_Operation(0 /* total collections, dummy, ignored */,
|
||||
0 /* total full collections, dummy, ignored */,
|
||||
request_full_gc) {
|
||||
_out = out;
|
||||
_full_gc = request_full_gc;
|
||||
_need_prologue = need_prologue;
|
||||
}
|
||||
|
||||
~VM_GC_HeapInspection() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue