< prev index next >

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

Print this page

        

*** 23,40 **** /** * @test TestMemoryMXBeans * @summary Test JMX memory beans * @key gc ! * @requires vm.gc.Shenandoah & !vm.graal.enabled * @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.*; --- 23,38 ---- /** * @test TestMemoryMXBeans * @summary Test JMX memory beans * @key gc ! * @requires vm.gc.Shenandoah * @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 */ import java.lang.management.*; import java.util.*;
*** 46,58 **** } 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(); --- 44,53 ----
*** 68,85 **** } 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 + " (init: " + initSize + ", max: " + maxSize + ")"); } } } --- 63,72 ---- } 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("Init committed heap size is wrong: " + heapCommitted + " (init: " + initSize + ", max: " + maxSize + ")"); } } }
< prev index next >