< prev index next >
src/share/vm/gc/serial/genMarkSweep.cpp
Print this page
@@ -68,24 +68,21 @@
assert(ref_processor() == NULL, "no stomping");
assert(rp != NULL, "should be non-NULL");
set_ref_processor(rp);
rp->setup_policy(clear_all_softrefs);
- GCTraceTime t1(GCCauseString("Full GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL);
+ GCTraceTime(Info, gc) t1("Full GC", NULL, gch->gc_cause(), true);
gch->trace_heap_before_gc(_gc_tracer);
// When collecting the permanent generation Method*s may be moving,
// so we either have to flush all bcp data or convert it into bci.
CodeCache::gc_prologue();
// Increment the invocation count
_total_invocations++;
- // Capture heap size before collection for printing.
- size_t gch_prev_used = gch->used();
-
// Capture used regions for each generation that will be
// subject to collection, so that card table adjustments can
// be made intelligently (see clear / invalidate further below).
gch->save_used_regions();
@@ -131,14 +128,10 @@
}
CodeCache::gc_epilogue();
JvmtiExport::gc_epilogue();
- if (PrintGC && !PrintGCDetails) {
- gch->print_heap_change(gch_prev_used);
- }
-
// refs processing: clean slate
set_ref_processor(NULL);
// Update heap occupancy information which is used as
// input to soft ref clearing policy at the next gc.
@@ -186,11 +179,11 @@
_objarray_stack.clear(true);
}
void GenMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) {
// Recursively traverse all live objects and mark them
- GCTraceTime tm("phase 1", PrintGC && Verbose, true, _gc_timer);
+ GCTraceTime(Trace, gc) tm("phase 1: Mark live objects", _gc_timer);
GenCollectedHeap* gch = GenCollectedHeap::heap();
// Because follow_root_closure is created statically, cannot
// use OopsInGenClosure constructor which takes a generation,
@@ -259,11 +252,11 @@
// phase2, phase3 and phase4, but the ValidateMarkSweep live oops
// tracking expects us to do so. See comment under phase4.
GenCollectedHeap* gch = GenCollectedHeap::heap();
- GCTraceTime tm("phase 2", PrintGC && Verbose, true, _gc_timer);
+ GCTraceTime(Trace, gc) tm("phase 2: Compute new object addresses", _gc_timer);
gch->prepare_for_compaction();
}
class GenAdjustPointersClosure: public GenCollectedHeap::GenClosure {
@@ -275,11 +268,11 @@
void GenMarkSweep::mark_sweep_phase3() {
GenCollectedHeap* gch = GenCollectedHeap::heap();
// Adjust the pointers to reflect the new locations
- GCTraceTime tm("phase 3", PrintGC && Verbose, true, _gc_timer);
+ GCTraceTime(Trace, gc) tm("phase 3: Adjust pointers", _gc_timer);
// Need new claim bits for the pointer adjustment tracing.
ClassLoaderDataGraph::clear_claimed_marks();
// Because the closure below is created statically, we cannot
@@ -327,10 +320,10 @@
// in the same order in phase2, phase3 and phase4. We don't quite do that
// here (perm_gen first rather than last), so we tell the validate code
// to use a higher index (saved from phase2) when verifying perm_gen.
GenCollectedHeap* gch = GenCollectedHeap::heap();
- GCTraceTime tm("phase 4", PrintGC && Verbose, true, _gc_timer);
+ GCTraceTime(Trace, gc) tm("phase 4: Move objects", _gc_timer);
GenCompactClosure blk;
gch->generation_iterate(&blk, true);
}
< prev index next >