< prev index next >

test/hotspot/jtreg/runtime/Metaspace/PrintMetaspaceDcmd.java

Print this page




  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  */
  24 
  25 import jdk.test.lib.process.ProcessTools;
  26 import jdk.test.lib.process.OutputAnalyzer;
  27 import jdk.test.lib.JDKToolFinder;
  28 
  29 /*
  30  * @test
  31  * @key metaspace jcmd
  32  * @summary Test the VM.metaspace command

  33  * @library /test/lib
  34  * @modules java.base/jdk.internal.misc
  35  *          java.management
  36  * @run main/othervm -XX:MaxMetaspaceSize=201M -Xmx100M -XX:+UseCompressedOops -XX:+UseCompressedClassPointers PrintMetaspaceDcmd with-compressed-class-space
  37  * @run main/othervm -XX:MaxMetaspaceSize=201M -Xmx100M -XX:-UseCompressedOops -XX:-UseCompressedClassPointers PrintMetaspaceDcmd without-compressed-class-space
  38  */
  39 
  40 public class PrintMetaspaceDcmd {
  41 
  42     // Run jcmd VM.metaspace against a VM with CompressedClassPointers on.
  43     // The report should detail Non-Class and Class portions separately.
  44     private static void doTheTest(boolean usesCompressedClassSpace) throws Exception {
  45         ProcessBuilder pb = new ProcessBuilder();
  46         OutputAnalyzer output;
  47         // Grab my own PID
  48         String pid = Long.toString(ProcessTools.getProcessId());
  49 
  50         pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.metaspace", "basic"});
  51         output = new OutputAnalyzer(pb.start());
  52         output.shouldHaveExitValue(0);




  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  */
  24 
  25 import jdk.test.lib.process.ProcessTools;
  26 import jdk.test.lib.process.OutputAnalyzer;
  27 import jdk.test.lib.JDKToolFinder;
  28 
  29 /*
  30  * @test
  31  * @key metaspace jcmd
  32  * @summary Test the VM.metaspace command
  33  * @requires vm.gc != "Z"
  34  * @library /test/lib
  35  * @modules java.base/jdk.internal.misc
  36  *          java.management
  37  * @run main/othervm -XX:MaxMetaspaceSize=201M -Xmx100M -XX:+UseCompressedOops -XX:+UseCompressedClassPointers PrintMetaspaceDcmd with-compressed-class-space
  38  * @run main/othervm -XX:MaxMetaspaceSize=201M -Xmx100M -XX:-UseCompressedOops -XX:-UseCompressedClassPointers PrintMetaspaceDcmd without-compressed-class-space
  39  */
  40 
  41 public class PrintMetaspaceDcmd {
  42 
  43     // Run jcmd VM.metaspace against a VM with CompressedClassPointers on.
  44     // The report should detail Non-Class and Class portions separately.
  45     private static void doTheTest(boolean usesCompressedClassSpace) throws Exception {
  46         ProcessBuilder pb = new ProcessBuilder();
  47         OutputAnalyzer output;
  48         // Grab my own PID
  49         String pid = Long.toString(ProcessTools.getProcessId());
  50 
  51         pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.metaspace", "basic"});
  52         output = new OutputAnalyzer(pb.start());
  53         output.shouldHaveExitValue(0);


< prev index next >