8204173: Lower the minimum number of heap memory pools in MemoryTest.java
Reviewed-by: mchung, sjohanss
--- a/test/jdk/java/lang/management/MemoryMXBean/MemoryTest.java Tue Jun 05 15:56:21 2018 +0200
+++ b/test/jdk/java/lang/management/MemoryMXBean/MemoryTest.java Tue Jun 05 15:56:23 2018 +0200
@@ -29,7 +29,7 @@
* @author Mandy Chung
*
* @modules jdk.management
- * @run main MemoryTest 2
+ * @run main MemoryTest 2 3
*/
/*
@@ -65,17 +65,24 @@
// - Code cache (between one and three depending on the -XX:SegmentedCodeCache option)
// - Metaspace
// - Compressed Class Space (if compressed class pointers are used)
- private static int[] expectedMinNumPools = {3, 2};
- private static int[] expectedMaxNumPools = {3, 5};
- private static int expectedNumGCMgrs = 2;
- private static int expectedNumMgrs = expectedNumGCMgrs + 2;
+
+ private static int[] expectedMinNumPools = new int[2];
+ private static int[] expectedMaxNumPools = new int[2];
+ private static int expectedNumGCMgrs;
+ private static int expectedNumMgrs;
private static String[] types = { "heap", "non-heap" };
public static void main(String args[]) throws Exception {
- Integer value = new Integer(args[0]);
- expectedNumGCMgrs = value.intValue();
+ expectedNumGCMgrs = Integer.valueOf(args[0]);
expectedNumMgrs = expectedNumGCMgrs + 2;
+ int expectedNumPools = Integer.valueOf(args[1]);
+ expectedMinNumPools[HEAP] = expectedNumPools;
+ expectedMaxNumPools[HEAP] = expectedNumPools;
+
+ expectedMinNumPools[NONHEAP] = 2;
+ expectedMaxNumPools[NONHEAP] = 5;
+
checkMemoryPools();
checkMemoryManagers();
if (testFailed)
--- a/test/jdk/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh Tue Jun 05 15:56:21 2018 +0200
+++ b/test/jdk/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh Tue Jun 05 15:56:23 2018 +0200
@@ -49,10 +49,10 @@
}
# Test MemoryTest with default collector
-runOne MemoryTest 2
+runOne MemoryTest 2 3
# Test MemoryTest with parallel scavenger collector
-runOne -XX:+UseParallelGC MemoryTest 2
+runOne -XX:+UseParallelGC MemoryTest 2 3
exit 0