From fcfd260c1fe44166dcff0ad1c2f315e073f0aefe Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Tue, 5 Jun 2018 15:56:23 +0200 Subject: [PATCH] 8204173: Lower the minimum number of heap memory pools in MemoryTest.java Reviewed-by: mchung, sjohanss --- .../management/MemoryMXBean/MemoryTest.java | 21 ++++++++++++------- .../MemoryMXBean/MemoryTestAllGC.sh | 4 ++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/test/jdk/java/lang/management/MemoryMXBean/MemoryTest.java b/test/jdk/java/lang/management/MemoryMXBean/MemoryTest.java index 340c1b6e636..44f8e606ebe 100644 --- a/test/jdk/java/lang/management/MemoryMXBean/MemoryTest.java +++ b/test/jdk/java/lang/management/MemoryMXBean/MemoryTest.java @@ -29,7 +29,7 @@ * @author Mandy Chung * * @modules jdk.management - * @run main MemoryTest 2 + * @run main MemoryTest 2 3 */ /* @@ -65,17 +65,24 @@ public class MemoryTest { // - 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) diff --git a/test/jdk/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh b/test/jdk/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh index d66ba73b4c0..ed330b2840e 100644 --- a/test/jdk/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh +++ b/test/jdk/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh @@ -49,10 +49,10 @@ runOne() } # 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