comparison src/share/vm/memory/genMarkSweep.cpp @ 20190:0982ec23da03

8043607: Add a GC id as a log decoration similar to PrintGCTimeStamps Reviewed-by: jwilhelm, ehelin, tschatzl
author brutisso
date Thu, 19 Jun 2014 13:31:14 +0200
parents bd902affe102
children 9fec19bb0659
comparison
equal deleted inserted replaced
20189:5d855d021755 20190:0982ec23da03
67 assert(ref_processor() == NULL, "no stomping"); 67 assert(ref_processor() == NULL, "no stomping");
68 assert(rp != NULL, "should be non-NULL"); 68 assert(rp != NULL, "should be non-NULL");
69 _ref_processor = rp; 69 _ref_processor = rp;
70 rp->setup_policy(clear_all_softrefs); 70 rp->setup_policy(clear_all_softrefs);
71 71
72 GCTraceTime t1(GCCauseString("Full GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL); 72 GCTraceTime t1(GCCauseString("Full GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL, _gc_tracer->gc_id());
73 73
74 gch->trace_heap_before_gc(_gc_tracer); 74 gch->trace_heap_before_gc(_gc_tracer);
75 75
76 // When collecting the permanent generation Method*s may be moving, 76 // When collecting the permanent generation Method*s may be moving,
77 // so we either have to flush all bcp data or convert it into bci. 77 // so we either have to flush all bcp data or convert it into bci.
191 } 191 }
192 192
193 void GenMarkSweep::mark_sweep_phase1(int level, 193 void GenMarkSweep::mark_sweep_phase1(int level,
194 bool clear_all_softrefs) { 194 bool clear_all_softrefs) {
195 // Recursively traverse all live objects and mark them 195 // Recursively traverse all live objects and mark them
196 GCTraceTime tm("phase 1", PrintGC && Verbose, true, _gc_timer); 196 GCTraceTime tm("phase 1", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id());
197 trace(" 1"); 197 trace(" 1");
198 198
199 GenCollectedHeap* gch = GenCollectedHeap::heap(); 199 GenCollectedHeap* gch = GenCollectedHeap::heap();
200 200
201 // Because follow_root_closure is created statically, cannot 201 // Because follow_root_closure is created statically, cannot
220 // Process reference objects found during marking 220 // Process reference objects found during marking
221 { 221 {
222 ref_processor()->setup_policy(clear_all_softrefs); 222 ref_processor()->setup_policy(clear_all_softrefs);
223 const ReferenceProcessorStats& stats = 223 const ReferenceProcessorStats& stats =
224 ref_processor()->process_discovered_references( 224 ref_processor()->process_discovered_references(
225 &is_alive, &keep_alive, &follow_stack_closure, NULL, _gc_timer); 225 &is_alive, &keep_alive, &follow_stack_closure, NULL, _gc_timer, _gc_tracer->gc_id());
226 gc_tracer()->report_gc_reference_stats(stats); 226 gc_tracer()->report_gc_reference_stats(stats);
227 } 227 }
228 228
229 // This is the point where the entire marking should have completed. 229 // This is the point where the entire marking should have completed.
230 assert(_marking_stack.is_empty(), "Marking should have completed"); 230 assert(_marking_stack.is_empty(), "Marking should have completed");
262 // phase2, phase3 and phase4, but the ValidateMarkSweep live oops 262 // phase2, phase3 and phase4, but the ValidateMarkSweep live oops
263 // tracking expects us to do so. See comment under phase4. 263 // tracking expects us to do so. See comment under phase4.
264 264
265 GenCollectedHeap* gch = GenCollectedHeap::heap(); 265 GenCollectedHeap* gch = GenCollectedHeap::heap();
266 266
267 GCTraceTime tm("phase 2", PrintGC && Verbose, true, _gc_timer); 267 GCTraceTime tm("phase 2", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id());
268 trace("2"); 268 trace("2");
269 269
270 gch->prepare_for_compaction(); 270 gch->prepare_for_compaction();
271 } 271 }
272 272
279 279
280 void GenMarkSweep::mark_sweep_phase3(int level) { 280 void GenMarkSweep::mark_sweep_phase3(int level) {
281 GenCollectedHeap* gch = GenCollectedHeap::heap(); 281 GenCollectedHeap* gch = GenCollectedHeap::heap();
282 282
283 // Adjust the pointers to reflect the new locations 283 // Adjust the pointers to reflect the new locations
284 GCTraceTime tm("phase 3", PrintGC && Verbose, true, _gc_timer); 284 GCTraceTime tm("phase 3", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id());
285 trace("3"); 285 trace("3");
286 286
287 // Need new claim bits for the pointer adjustment tracing. 287 // Need new claim bits for the pointer adjustment tracing.
288 ClassLoaderDataGraph::clear_claimed_marks(); 288 ClassLoaderDataGraph::clear_claimed_marks();
289 289
334 // in the same order in phase2, phase3 and phase4. We don't quite do that 334 // in the same order in phase2, phase3 and phase4. We don't quite do that
335 // here (perm_gen first rather than last), so we tell the validate code 335 // here (perm_gen first rather than last), so we tell the validate code
336 // to use a higher index (saved from phase2) when verifying perm_gen. 336 // to use a higher index (saved from phase2) when verifying perm_gen.
337 GenCollectedHeap* gch = GenCollectedHeap::heap(); 337 GenCollectedHeap* gch = GenCollectedHeap::heap();
338 338
339 GCTraceTime tm("phase 4", PrintGC && Verbose, true, _gc_timer); 339 GCTraceTime tm("phase 4", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id());
340 trace("4"); 340 trace("4");
341 341
342 GenCompactClosure blk; 342 GenCompactClosure blk;
343 gch->generation_iterate(&blk, true); 343 gch->generation_iterate(&blk, true);
344 } 344 }