--- old/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2018-09-04 14:50:24.431657410 +0000 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2018-09-04 14:50:24.255655449 +0000 @@ -1150,6 +1150,7 @@ // include the waste in the following calculations. const size_t capacity_after_gc = capacity(); const size_t used_after_gc = capacity_after_gc - unused_committed_regions_in_bytes(); + _last_heap_resize = os::elapsedTime(); // This is enforced in arguments.cpp. assert(MinHeapFreeRatio <= MaxHeapFreeRatio, @@ -1423,6 +1424,7 @@ _gc_tracer_stw(new (ResourceObj::C_HEAP, mtGC) G1NewTracer()), _g1_policy(new G1Policy(_gc_timer_stw)), _collection_set(this, _g1_policy), + _last_heap_resize(0.0), _dirty_card_queue_set(false), _ref_processor_stw(NULL), _is_alive_closure_stw(this), @@ -1906,6 +1908,7 @@ switch (cause) { case GCCause::_gc_locker: return GCLockerInvokesConcurrent; case GCCause::_g1_humongous_allocation: return true; + case GCCause::_g1_idle_compaction: return true; default: return is_user_requested_concurrent_full_gc(cause); } }