RFR (T) 8231395: Backout JDK-8231249

Aleksey Shipilev shade at redhat.com
Tue Sep 24 07:43:46 UTC 2019


Bug:
 https://bugs.openjdk.java.net/browse/JDK-8231395

JDK-8231249 caused some testing failures, notably in:
  gc/shenandoah/oom/TestClassLoaderLeak.java failed (JDK-8231389)
  gc/shenandoah/TestAllocHumongousFragment.java

The reason is that those tests expect us to eventually come to Full GC, and JDK-8231249 prevents
that. It requires more comprehensive fix. Let's backout the bad fix meanwhile.

Fix, produced by "hg backout"

diff -r ef8c8cf9256a src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp        Fri Sep 20 10:28:48 2019 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp        Tue Sep 24 09:42:57 2019 +0200
@@ -810,10 +810,20 @@
     // other threads have already depleted the free storage. In this case, a better
     // strategy is to try again, as long as GC makes progress.
-
-    if (result == NULL) {
-      do {
-        control_thread()->handle_alloc_failure(req.size());
-        result = allocate_memory_under_lock(req, in_new_region);
-      } while (result == NULL && _progress_last_gc.is_set());
+    //
+    // Then, we need to make sure the allocation was retried after at least one
+    // Full GC, which means we want to try more than ShenandoahFullGCThreshold times.
+
+    size_t tries = 0;
+
+    while (result == NULL && _progress_last_gc.is_set()) {
+      tries++;
+      control_thread()->handle_alloc_failure(req.size());
+      result = allocate_memory_under_lock(req, in_new_region);
+    }
+
+    while (result == NULL && tries <= ShenandoahFullGCThreshold) {
+      tries++;
+      control_thread()->handle_alloc_failure(req.size());
+      result = allocate_memory_under_lock(req, in_new_region);
     }


Testing: hotspot_gc_shenandoah

-- 
Thanks,
-Aleksey



More information about the shenandoah-dev mailing list