8209743: [TESTBUG] java/lang/management/MemoryMXBean/LowMemoryTest2.sh fails with OutOfMemoryError running in CDS mode
Summary: increase the MaxMetaspaceSize from 16m to 32m
Reviewed-by: jiangli, iklam, mchung
--- a/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest2.sh Tue Aug 28 18:31:14 2018 -0400
+++ b/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest2.sh Tue Aug 28 16:18:58 2018 -0700
@@ -54,12 +54,12 @@
# Run test with each GC configuration
#
# Notes: To ensure that metaspace fills up we disable class unloading.
-# Also we set the max metaspace to 16MB - otherwise the test takes too
-# long to run.
+# Also we set the max metaspace to 16MB/32MB - otherwise the test takes too
+# long to run. The 32MB setting is required for running with CDS archive.
-go -noclassgc -XX:MaxMetaspaceSize=16m -XX:+UseSerialGC LowMemoryTest2
-go -noclassgc -XX:MaxMetaspaceSize=16m -XX:+UseParallelGC LowMemoryTest2
-go -noclassgc -XX:MaxMetaspaceSize=16m -XX:+UseConcMarkSweepGC LowMemoryTest2
+go -noclassgc -XX:MaxMetaspaceSize=32m -XX:+UseSerialGC LowMemoryTest2
+go -noclassgc -XX:MaxMetaspaceSize=32m -XX:+UseParallelGC LowMemoryTest2
+go -noclassgc -XX:MaxMetaspaceSize=32m -XX:+UseConcMarkSweepGC LowMemoryTest2
# Test class metaspace - might hit MaxMetaspaceSize instead if
# UseCompressedClassPointers is off or if 32 bit.