< prev index next >

src/share/vm/gc/g1/vm_operations_g1.cpp

Print this page
rev 9413 : [mq]: JDK-8130265_3

@@ -147,21 +147,25 @@
 
   _pause_succeeded =
     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) {
       // Another possible reason reason for the pause to not be successful
       // is that, again, the GC locker is active (and has become active
       // 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 */);
+      }
     }
   }
 }
 
 void VM_G1IncCollectionPause::doit_epilogue() {
< prev index next >