--- old/src/share/vm/gc/shenandoah/shenandoahConcurrentThread.cpp 2017-05-03 18:44:41.637105719 +0200 +++ new/src/share/vm/gc/shenandoah/shenandoahConcurrentThread.cpp 2017-05-03 18:44:41.581106693 +0200 @@ -198,7 +198,21 @@ GCTraceTime(Info, gc) time("Concurrent update references ", gc_timer, GCCause::_no_gc, true); heap->concurrent_update_heap_references(); } - if (check_cancellation()) return; + + clear_full_gc = false; + if (heap->cancelled_concgc()) { + heap->shenandoahPolicy()->record_uprefs_cancelled(); + if (_full_gc_cause == GCCause::_allocation_failure && + heap->shenandoahPolicy()->handover_cancelled_uprefs()) { + clear_full_gc = true; + heap->shenandoahPolicy()->record_uprefs_degenerated(); + } else { + heap->gc_timer()->register_gc_end(); + return; + } + } else { + heap->shenandoahPolicy()->record_uprefs_success(); + } VM_ShenandoahFinalUpdateRefs final_update_refs; @@ -212,6 +226,10 @@ // Prepare for the next normal cycle: if (check_cancellation()) return; + if (clear_full_gc) { + reset_full_gc(); + } + { GCTraceTime(Info, gc) time("Concurrent reset bitmaps", gc_timer, GCCause::_no_gc); heap->shenandoahPolicy()->record_phase_start(ShenandoahCollectorPolicy::reset_bitmaps);