mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-06 21:18:42 +00:00
runtime/Metaspace/PrintMetaspaceDcmd.java
This commit is contained in:
parent
c4adf3680d
commit
4ae8591e28
@ -22,62 +22,27 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
import jdk.test.lib.Platform;
|
||||
import jdk.test.lib.dcmd.PidJcmdExecutor;
|
||||
import jdk.test.lib.process.OutputAnalyzer;
|
||||
|
||||
/*
|
||||
* @test id=test-64bit-ccs
|
||||
* @summary Test the VM.metaspace command
|
||||
* @requires vm.bits == "64"
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
* @run main/othervm -Dwith-compressed-class-space -XX:MaxMetaspaceSize=201M -Xmx100M -XX:+UseCompressedOops -XX:+USE_COMPRESSED_CLASS_POINTERS_ALWAYS_TRUE PrintMetaspaceDcmd
|
||||
*/
|
||||
import java.io.IOException;
|
||||
|
||||
/*
|
||||
* @test id=test-64bit-noccs
|
||||
* @test
|
||||
* @summary Test the VM.metaspace command
|
||||
* @requires vm.bits == "64"
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
* @run main/othervm -Dwithout-compressed-class-space -XX:MaxMetaspaceSize=201M -Xmx100M -XX:-UseCompressedOops -XX:-USE_COMPRESSED_CLASS_POINTERS_ALWAYS_TRUE PrintMetaspaceDcmd
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test id=test-nospecified
|
||||
* @summary Test the VM.metaspace command
|
||||
* @requires vm.bits == "64"
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
* @run main/othervm -Dno-specified-flag -Xmx100M -XX:-UseCompressedOops -XX:-USE_COMPRESSED_CLASS_POINTERS_ALWAYS_TRUE PrintMetaspaceDcmd
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test test-32bit
|
||||
* @summary Test the VM.metaspace command
|
||||
* @requires vm.bits == "32"
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
* @run main/othervm -Dwithout-compressed-class-space -XX:MaxMetaspaceSize=201M -Xmx100M PrintMetaspaceDcmd
|
||||
* @run main/othervm -Dwith-compressed-class-space -XX:MaxMetaspaceSize=201M -Xmx100M PrintMetaspaceDcmd
|
||||
*/
|
||||
|
||||
public class PrintMetaspaceDcmd {
|
||||
|
||||
private static void doTheNoSpecifiedPropTest() throws Exception {
|
||||
ProcessBuilder pb = new ProcessBuilder();
|
||||
OutputAnalyzer output;
|
||||
public static void main(String [] args) throws IOException {
|
||||
|
||||
pb.command(new PidJcmdExecutor().getCommandLine("VM.metaspace", "basic"));
|
||||
output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
output.shouldMatch("MaxMetaspaceSize: unlimited");
|
||||
}
|
||||
final boolean usesCompressedClassSpace = Platform.is64bit();
|
||||
|
||||
private static void doTheCCSPropTest(boolean usesCompressedClassSpace) throws Exception {
|
||||
ProcessBuilder pb = new ProcessBuilder();
|
||||
OutputAnalyzer output;
|
||||
|
||||
@ -172,15 +137,4 @@ public class PrintMetaspaceDcmd {
|
||||
output.shouldMatch("MaxMetaspaceSize:.*210763776 bytes");
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
if (System.getProperty("no-specified-flag") != null) {
|
||||
doTheNoSpecifiedPropTest();
|
||||
} else if (System.getProperty("with-compressed-class-space") != null) {
|
||||
doTheCCSPropTest(true);
|
||||
} else if (System.getProperty("without-compressed-class-space") != null) {
|
||||
doTheCCSPropTest(false);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unrecognized running mode");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user