< prev index next >

test/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java

Print this page
rev 7696 : 8061802: REDO - Remove the generations array
Summary: The _gens array is removed and replaced by explicit _young_gen and _old_gen variables.
Reviewed-by:


  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test CompressedClassSpaceSizeInJmapHeap
  26  * @bug 8004924
  27  * @summary Checks that jmap -heap contains the flag CompressedClassSpaceSize
  28  * @library /testlibrary
  29  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompressedClassSpaceSize=50m CompressedClassSpaceSizeInJmapHeap
  30  */
  31 
  32 import com.oracle.java.testlibrary.*;
  33 import java.nio.file.*;
  34 import java.io.File;
  35 import java.nio.charset.Charset;
  36 import java.util.List;
  37 
  38 public class CompressedClassSpaceSizeInJmapHeap {

  39     public static void main(String[] args) throws Exception {
  40         if (!Platform.is64bit()) {
  41             // Compressed Class Space is only available on 64-bit JVMs
  42             return;
  43         }
  44 
  45         String pid = Integer.toString(ProcessTools.getProcessId());
  46 
  47         JDKToolLauncher jmap = JDKToolLauncher.create("jmap")
  48                                               .addToolArg("-heap")
  49                                               .addToolArg(pid);
  50         ProcessBuilder pb = new ProcessBuilder(jmap.getCommand());
  51 
  52         File out = new File("CompressedClassSpaceSizeInJmapHeap.stdout.txt");
  53         pb.redirectOutput(out);
  54 
  55         File err = new File("CompressedClassSpaceSizeInJmapHeap.stderr.txt");
  56         pb.redirectError(err);
  57 
  58         run(pb);




  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test CompressedClassSpaceSizeInJmapHeap
  26  * @bug 8004924
  27  * @summary Checks that jmap -heap contains the flag CompressedClassSpaceSize
  28  * @library /testlibrary
  29  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompressedClassSpaceSize=50m CompressedClassSpaceSizeInJmapHeap
  30  */
  31 
  32 import com.oracle.java.testlibrary.*;
  33 import java.nio.file.*;
  34 import java.io.File;
  35 import java.nio.charset.Charset;
  36 import java.util.List;
  37 
  38 public class CompressedClassSpaceSizeInJmapHeap {
  39     // Note that on some platforms it may require root privileges to run this test.
  40     public static void main(String[] args) throws Exception {
  41         if (!Platform.is64bit()) {
  42             // Compressed Class Space is only available on 64-bit JVMs
  43             return;
  44         }
  45 
  46         String pid = Integer.toString(ProcessTools.getProcessId());
  47 
  48         JDKToolLauncher jmap = JDKToolLauncher.create("jmap")
  49                                               .addToolArg("-heap")
  50                                               .addToolArg(pid);
  51         ProcessBuilder pb = new ProcessBuilder(jmap.getCommand());
  52 
  53         File out = new File("CompressedClassSpaceSizeInJmapHeap.stdout.txt");
  54         pb.redirectOutput(out);
  55 
  56         File err = new File("CompressedClassSpaceSizeInJmapHeap.stderr.txt");
  57         pb.redirectError(err);
  58 
  59         run(pb);


< prev index next >