< prev index next >

test/hotspot/jtreg/gc/shenandoah/mxbeans/TestMemoryMXBeans.java

Print this page

        

@@ -29,12 +29,10 @@
  * @modules java.base/jdk.internal.misc
  *          java.management
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC          -Xmx1g TestMemoryMXBeans   -1 1024
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xms1g   -Xmx1g TestMemoryMXBeans 1024 1024
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xms128m -Xmx1g TestMemoryMXBeans  128 1024
- * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xms1g   -Xmx1g -XX:ShenandoahUncommitDelay=0 TestMemoryMXBeans 1024 1024
- * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xms128m -Xmx1g -XX:ShenandoahUncommitDelay=0 TestMemoryMXBeans  128 1024
  */
 
 import java.lang.management.*;
 import java.util.*;
 

@@ -46,13 +44,10 @@
         }
 
         long initSize = 1L * Integer.parseInt(args[0]) * 1024 * 1024;
         long maxSize  = 1L * Integer.parseInt(args[1]) * 1024 * 1024;
 
-        // wait for GC to uncommit
-        Thread.sleep(1000);
-
         testMemoryBean(initSize, maxSize);
     }
 
     public static void testMemoryBean(long initSize, long maxSize) {
         MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();

@@ -68,18 +63,10 @@
         }
         if (maxSize > 0 && heapMax != maxSize) {
             throw new IllegalStateException("Max heap size is wrong: " + heapMax + " vs " + maxSize);
         }
         if (initSize > 0 && maxSize > 0 && initSize != maxSize && heapCommitted == heapMax) {
-            throw new IllegalStateException("Committed heap size is max: " + heapCommitted +
-                                            " (init: " + initSize + ", max: " + maxSize + ")");
-        }
-        if (initSize > 0 && maxSize > 0 && initSize == maxSize && heapCommitted != heapMax) {
-            throw new IllegalStateException("Committed heap size is not max: " + heapCommitted +
-                                            " (init: " + initSize + ", max: " + maxSize + ")");
-        }
-        if (initSize > 0 && heapCommitted < initSize) {
-            throw new IllegalStateException("Committed heap size is below min: " + heapCommitted +
+            throw new IllegalStateException("Init committed heap size is wrong: " + heapCommitted +
                                             " (init: " + initSize + ", max: " + maxSize + ")");
         }
     }
 }
< prev index next >