< prev index next > test/hotspot/jtreg/runtime/CompressedOops/CompressedClassSpaceSize.java
Print this page
final static long MB = 1024 * 1024;
final static long minAllowedClassSpaceSize = MB;
final static long minRealClassSpaceSize = 16 * MB;
! final static long maxClassSpaceSize = 4096 * MB;
// For the valid_large_cds sub test: we need to have a notion of what archive size to
// maximally expect, with a generous fudge factor to avoid having to tweak this test
// ofent. Note: today's default archives are around 16-20 MB.
final static long maxExpectedArchiveSize = 512 * MB;
final static long MB = 1024 * 1024;
final static long minAllowedClassSpaceSize = MB;
final static long minRealClassSpaceSize = 16 * MB;
! final static long maxClassSpaceSize = 512 * MB;
// For the valid_large_cds sub test: we need to have a notion of what archive size to
// maximally expect, with a generous fudge factor to avoid having to tweak this test
// ofent. Note: today's default archives are around 16-20 MB.
final static long maxExpectedArchiveSize = 512 * MB;
output.shouldMatch("Compressed class space.*" + maxClassSpaceSize)
.shouldHaveExitValue(0);
}
break;
case "valid_large_cds": {
! // Create archive
! pb = ProcessTools.createLimitedTestJavaProcessBuilder(
! "-XX:SharedArchiveFile=./abc.jsa", "-Xshare:dump", "-version");
! output = new OutputAnalyzer(pb.start());
! output.shouldHaveExitValue(0);
! // With CDS, class space should fill whatever the CDS archive leaves us (modulo alignment)
! pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:CompressedClassSpaceSize=" + maxClassSpaceSize,
! "-XX:SharedArchiveFile=./abc.jsa", "-Xshare:on", "-Xlog:metaspace*", "-version");
! output = new OutputAnalyzer(pb.start());
! output.shouldHaveExitValue(0);
! long reducedSize = Long.parseLong(
! output.firstMatch("reducing class space size from " + maxClassSpaceSize + " to (\\d+)", 1));
! if (reducedSize < (maxClassSpaceSize - maxExpectedArchiveSize)) {
! output.reportDiagnosticSummary();
! throw new RuntimeException("Class space size too small?");
! }
! output.shouldMatch("Compressed class space.*" + reducedSize);
}
break;
default:
throw new RuntimeException("invalid sub test " + args[0]);
}
output.shouldMatch("Compressed class space.*" + maxClassSpaceSize)
.shouldHaveExitValue(0);
}
break;
case "valid_large_cds": {
! // TODO: Does not currently work with +UseCompactObjectHeaders.
! // // Create archive
! // pb = ProcessTools.createLimitedTestJavaProcessBuilder(
! // "-XX:SharedArchiveFile=./abc.jsa", "-Xshare:dump", "-version");
! // output = new OutputAnalyzer(pb.start());
+ // output.shouldHaveExitValue(0);
! // // With CDS, class space should fill whatever the CDS archive leaves us (modulo alignment)
! // pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:CompressedClassSpaceSize=" + maxClassSpaceSize,
! // "-XX:SharedArchiveFile=./abc.jsa", "-Xshare:on", "-Xlog:metaspace*", "-version");
! // output = new OutputAnalyzer(pb.start());
! // output.shouldHaveExitValue(0);
! // long reducedSize = Long.parseLong(
! // output.firstMatch("reducing class space size from " + maxClassSpaceSize + " to (\\d+)", 1));
! // if (reducedSize < (maxClassSpaceSize - maxExpectedArchiveSize)) {
! // output.reportDiagnosticSummary();
! // throw new RuntimeException("Class space size too small?");
! // }
! // output.shouldMatch("Compressed class space.*" + reducedSize);
}
break;
default:
throw new RuntimeException("invalid sub test " + args[0]);
}
< prev index next >