1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Wed Mar 25 11:03:16 2015 +0100 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Mon Aug 25 09:10:13 2014 +0200 1.3 @@ -1877,6 +1877,7 @@ 1.4 _old_marking_cycles_started(0), 1.5 _old_marking_cycles_completed(0), 1.6 _concurrent_cycle_started(false), 1.7 + _heap_summary_sent(false), 1.8 _in_cset_fast_test(), 1.9 _dirty_cards_region_list(NULL), 1.10 _worker_cset_start_region(NULL), 1.11 @@ -2447,13 +2448,24 @@ 1.12 _gc_timer_cm->register_gc_end(); 1.13 _gc_tracer_cm->report_gc_end(_gc_timer_cm->gc_end(), _gc_timer_cm->time_partitions()); 1.14 1.15 + // Clear state variables to prepare for the next concurrent cycle. 1.16 _concurrent_cycle_started = false; 1.17 + _heap_summary_sent = false; 1.18 } 1.19 } 1.20 1.21 void G1CollectedHeap::trace_heap_after_concurrent_cycle() { 1.22 if (_concurrent_cycle_started) { 1.23 - trace_heap_after_gc(_gc_tracer_cm); 1.24 + // This function can be called when: 1.25 + // the cleanup pause is run 1.26 + // the concurrent cycle is aborted before the cleanup pause. 1.27 + // the concurrent cycle is aborted after the cleanup pause, 1.28 + // but before the concurrent cycle end has been registered. 1.29 + // Make sure that we only send the heap information once. 1.30 + if (!_heap_summary_sent) { 1.31 + trace_heap_after_gc(_gc_tracer_cm); 1.32 + _heap_summary_sent = true; 1.33 + } 1.34 } 1.35 } 1.36