2312 // and it's waiting for a full GC to finish will be woken up. It is
2313 // waiting in VM_G1IncCollectionPause::doit_epilogue().
2314 FullGCCount_lock->notify_all();
2315 }
2316
2317 void G1CollectedHeap::register_concurrent_cycle_start(const Ticks& start_time) {
2318 GCIdMarkAndRestore conc_gc_id_mark;
2319 collector_state()->set_concurrent_cycle_started(true);
2320 _gc_timer_cm->register_gc_start(start_time);
2321
2322 _gc_tracer_cm->report_gc_start(gc_cause(), _gc_timer_cm->gc_start());
2323 trace_heap_before_gc(_gc_tracer_cm);
2324 _cmThread->set_gc_id(GCId::current());
2325 }
2326
2327 void G1CollectedHeap::register_concurrent_cycle_end() {
2328 if (collector_state()->concurrent_cycle_started()) {
2329 GCIdMarkAndRestore conc_gc_id_mark(_cmThread->gc_id());
2330 if (_cm->has_aborted()) {
2331 _gc_tracer_cm->report_concurrent_mode_failure();
2332 }
2333
2334 _gc_timer_cm->register_gc_end();
2335 _gc_tracer_cm->report_gc_end(_gc_timer_cm->gc_end(), _gc_timer_cm->time_partitions());
2336
2337 // Clear state variables to prepare for the next concurrent cycle.
2338 collector_state()->set_concurrent_cycle_started(false);
2339 _heap_summary_sent = false;
2340 }
2341 }
2342
2343 void G1CollectedHeap::trace_heap_after_concurrent_cycle() {
2344 if (collector_state()->concurrent_cycle_started()) {
2345 // This function can be called when:
2346 // the cleanup pause is run
2347 // the concurrent cycle is aborted before the cleanup pause.
2348 // the concurrent cycle is aborted after the cleanup pause,
2349 // but before the concurrent cycle end has been registered.
2350 // Make sure that we only send the heap information once.
2351 if (!_heap_summary_sent) {
2352 GCIdMarkAndRestore conc_gc_id_mark(_cmThread->gc_id());
2353 trace_heap_after_gc(_gc_tracer_cm);
2354 _heap_summary_sent = true;
|
2312 // and it's waiting for a full GC to finish will be woken up. It is
2313 // waiting in VM_G1IncCollectionPause::doit_epilogue().
2314 FullGCCount_lock->notify_all();
2315 }
2316
2317 void G1CollectedHeap::register_concurrent_cycle_start(const Ticks& start_time) {
2318 GCIdMarkAndRestore conc_gc_id_mark;
2319 collector_state()->set_concurrent_cycle_started(true);
2320 _gc_timer_cm->register_gc_start(start_time);
2321
2322 _gc_tracer_cm->report_gc_start(gc_cause(), _gc_timer_cm->gc_start());
2323 trace_heap_before_gc(_gc_tracer_cm);
2324 _cmThread->set_gc_id(GCId::current());
2325 }
2326
2327 void G1CollectedHeap::register_concurrent_cycle_end() {
2328 if (collector_state()->concurrent_cycle_started()) {
2329 GCIdMarkAndRestore conc_gc_id_mark(_cmThread->gc_id());
2330 if (_cm->has_aborted()) {
2331 _gc_tracer_cm->report_concurrent_mode_failure();
2332
2333 // ConcurrentGCTimer will be ended as well.
2334 _cm->register_concurrent_gc_end();
2335 } else {
2336 _gc_timer_cm->register_gc_end();
2337 }
2338
2339 _gc_tracer_cm->report_gc_end(_gc_timer_cm->gc_end(), _gc_timer_cm->time_partitions());
2340
2341 // Clear state variables to prepare for the next concurrent cycle.
2342 collector_state()->set_concurrent_cycle_started(false);
2343 _heap_summary_sent = false;
2344 }
2345 }
2346
2347 void G1CollectedHeap::trace_heap_after_concurrent_cycle() {
2348 if (collector_state()->concurrent_cycle_started()) {
2349 // This function can be called when:
2350 // the cleanup pause is run
2351 // the concurrent cycle is aborted before the cleanup pause.
2352 // the concurrent cycle is aborted after the cleanup pause,
2353 // but before the concurrent cycle end has been registered.
2354 // Make sure that we only send the heap information once.
2355 if (!_heap_summary_sent) {
2356 GCIdMarkAndRestore conc_gc_id_mark(_cmThread->gc_id());
2357 trace_heap_after_gc(_gc_tracer_cm);
2358 _heap_summary_sent = true;
|