< prev index next >
test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java
Print this page
rev 60818 : imported patch jep387-test.patch
*** 34,48 ****
public class MaxMetaspaceSizeTest {
public static void main(String... args) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
"-Xmx1g",
! "-XX:InitialBootClassLoaderMetaspaceSize=4195328",
! "-XX:MaxMetaspaceSize=4195328",
"-XX:+UseCompressedClassPointers",
"-XX:CompressedClassSpaceSize=1g",
"--version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
! output.shouldContain("MaxMetaspaceSize is too small.");
output.shouldNotHaveExitValue(0);
}
}
--- 34,51 ----
public class MaxMetaspaceSizeTest {
public static void main(String... args) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
"-Xmx1g",
! "-XX:MaxMetaspaceSize=4K",
"-XX:+UseCompressedClassPointers",
"-XX:CompressedClassSpaceSize=1g",
"--version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
! // We do not explicitly limit MaxMetaspaceSize to a lower minimum. User can get as low as he wants.
! // However, you most certainly will hit either one of
! // "OutOfMemoryError: Metaspace" or
! // "OutOfMemoryError: Compressed class space"
! output.shouldMatch("OutOfMemoryError.*(Compressed class space|Metaspace)");
output.shouldNotHaveExitValue(0);
}
}
< prev index next >