8232951: TestG1ParallelPhases.java fails with phase NonYoungFreeCSet not found
authortschatzl
Mon, 04 Nov 2019 11:33:15 +0100
changeset 58910 f61eea1869e4
parent 58909 66f7d2494d4e
child 58911 2c777f25cfff
child 58912 44d60fc2dd8a
8232951: TestG1ParallelPhases.java fails with phase NonYoungFreeCSet not found Reviewed-by: lkorinth, kbarrett
test/jdk/jdk/jfr/event/gc/collection/TestG1ParallelPhases.java
--- a/test/jdk/jdk/jfr/event/gc/collection/TestG1ParallelPhases.java	Mon Nov 04 11:15:45 2019 +0100
+++ b/test/jdk/jdk/jfr/event/gc/collection/TestG1ParallelPhases.java	Mon Nov 04 11:33:15 2019 +0100
@@ -59,7 +59,8 @@
  * @library /test/lib /test/jdk
  * @build sun.hotspot.WhiteBox
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:MaxTenuringThreshold=1 -Xms20M -Xmx20M
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+AlwaysTenure
+ *      -Xms20M -Xmx20M -Xlog:gc=debug,gc+heap*=debug,gc+ergo*=debug,gc+start=debug
  *      -XX:G1MixedGCLiveThresholdPercent=100 -XX:G1HeapWastePercent=0 -XX:G1HeapRegionSize=1m
  *      -XX:+UseG1GC -XX:+UseStringDeduplication
  *      -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
@@ -75,7 +76,7 @@
         recording.start();
 
         // create more weak garbage than can fit in this heap (-Xmx20m), will force collection of weak references
-        weakRefs = range(1, 100)
+        weakRefs = range(1, 30)
             .mapToObj(n -> new WeakReference<>(new byte[1_000_000]))
             .collect(toList()); // force evaluation of lazy stream (all weak refs must be created)
 
@@ -150,8 +151,7 @@
             toUnreachable.add(new byte[arraySize]);
         });
 
-        // Do two young collections, MaxTenuringThreshold=1 will force promotion.
-        getWhiteBox().youngGC();
+        // Do one young collection, AlwaysTenure will force promotion.
         getWhiteBox().youngGC();
 
         // Check it is promoted & keep alive
@@ -167,11 +167,10 @@
 
     /**
     * The necessary condition for guaranteed mixed GC is running in VM with the following flags:
-    * -XX:+UnlockExperimentalVMOptions -XX:MaxTenuringThreshold=1 -Xms{HEAP_SIZE}M
+    * -XX:+UnlockExperimentalVMOptions -XX:+AlwaysTenure -Xms{HEAP_SIZE}M
     * -Xmx{HEAP_SIZE}M -XX:G1MixedGCLiveThresholdPercent=100 -XX:G1HeapWastePercent=0
     * -XX:G1HeapRegionSize={REGION_SIZE}m
     *
-    * @param provokeSize The size to allocate to provoke the start of a mixed gc (half heap size?)
     * @param g1HeapRegionSize The size of your regions in bytes
     */
     public static void provokeMixedGC(int g1HeapRegionSize) {