# HG changeset patch # User asiebenborn # Date 1448013434 -3600 # Fri Nov 20 10:57:14 2015 +0100 # Node ID d1a0f37aee725d6d8ca50e66c8699e907c9d25ff # Parent 44df756148b3d6ee6884c924868bae46cf041abe [mq]: JDK-8130265_3 diff --git a/src/share/vm/gc/g1/vm_operations_g1.cpp b/src/share/vm/gc/g1/vm_operations_g1.cpp --- a/src/share/vm/gc/g1/vm_operations_g1.cpp +++ b/src/share/vm/gc/g1/vm_operations_g1.cpp @@ -149,9 +149,7 @@ g1h->do_collection_pause_at_safepoint(_target_pause_time_ms); if (_pause_succeeded && _word_size > 0) { // An allocation had been requested. - _result = g1h->attempt_allocation_at_safepoint(_word_size, - allocation_context(), - true /* expect_null_cur_alloc_region */); + _result = g1h->satisfy_failed_allocation(_word_size, allocation_context(), &_pause_succeeded); } else { assert(_result == NULL, "invariant"); if (!_pause_succeeded) { @@ -160,6 +158,12 @@ // since the prologue was executed). In this case we should retry // the pause after waiting for the GC locker to become inactive. _should_retry_gc = true; + } else { + // if this gc has been triggered by the GCLocker, we did not try to allocate. + // However, we should start a full GC, if we didn't free any memory. + if (g1h->evacuation_failed()) { + g1h->do_full_collection(true /* clear_all_soft_refs */); + } } } }