< prev index next >

test/hotspot/jtreg/serviceability/sa/TestUniverse.java

Print this page




  89         System.out.println(output.getOutput());
  90 
  91         output.shouldContain("Heap Parameters");
  92         if (gc.contains("G1GC")) {
  93             output.shouldContain("garbage-first heap");
  94             output.shouldContain("region size");
  95             output.shouldContain("G1 Young Generation:");
  96             output.shouldContain("regions  =");
  97         }
  98         if (gc.contains("UseConcMarkSweepGC")) {
  99             output.shouldContain("Gen 1: concurrent mark-sweep generation");
 100         }
 101         if (gc.contains("UseSerialGC")) {
 102             output.shouldContain("Gen 1:   old");
 103         }
 104         if (gc.contains("UseParallelGC")) {
 105             output.shouldContain("ParallelScavengeHeap");
 106             output.shouldContain("PSYoungGen");
 107             output.shouldContain("eden");
 108         }
 109 





 110     }
 111 
 112     public static void test(String gc) throws Exception {
 113         LingeredApp app = null;
 114         try {
 115             List<String> vmArgs = new ArrayList<String>();

 116             vmArgs.add(gc);
 117             app = LingeredApp.startApp(vmArgs);
 118             System.out.println ("Started LingeredApp with the GC option " + gc +
 119                                 " and pid " + app.getPid());
 120             testClhsdbForUniverse(app.getPid(), gc);
 121         } finally {
 122             LingeredApp.stopApp(app);
 123         }
 124     }
 125 
 126 
 127     public static void main (String... args) throws Exception {
 128 
 129         if (!Platform.shouldSAAttach()) {
 130             System.out.println(
 131                "SA attach not expected to work - test skipped.");
 132             return;
 133         }
 134 
 135         try {
 136             test("-XX:+UseG1GC");
 137             test("-XX:+UseParallelGC");
 138             test("-XX:+UseSerialGC");
 139             if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
 140               test("-XX:+UseConcMarkSweepGC");
 141             }

 142         } catch (Exception e) {
 143             throw new Error("Test failed with " + e);
 144         }
 145     }
 146 }


  89         System.out.println(output.getOutput());
  90 
  91         output.shouldContain("Heap Parameters");
  92         if (gc.contains("G1GC")) {
  93             output.shouldContain("garbage-first heap");
  94             output.shouldContain("region size");
  95             output.shouldContain("G1 Young Generation:");
  96             output.shouldContain("regions  =");
  97         }
  98         if (gc.contains("UseConcMarkSweepGC")) {
  99             output.shouldContain("Gen 1: concurrent mark-sweep generation");
 100         }
 101         if (gc.contains("UseSerialGC")) {
 102             output.shouldContain("Gen 1:   old");
 103         }
 104         if (gc.contains("UseParallelGC")) {
 105             output.shouldContain("ParallelScavengeHeap");
 106             output.shouldContain("PSYoungGen");
 107             output.shouldContain("eden");
 108         }
 109         if (gc.contains("UseEpsilonGC")) {
 110             output.shouldContain("Epsilon heap");
 111             output.shouldContain("reserved");
 112             output.shouldContain("committed");
 113             output.shouldContain("used");
 114         }
 115     }
 116 
 117     public static void test(String gc) throws Exception {
 118         LingeredApp app = null;
 119         try {
 120             List<String> vmArgs = new ArrayList<String>();
 121             vmArgs.add("-XX:+UnlockExperimentalVMOptions"); // unlock experimental GCs
 122             vmArgs.add(gc);
 123             app = LingeredApp.startApp(vmArgs);
 124             System.out.println ("Started LingeredApp with the GC option " + gc +
 125                                 " and pid " + app.getPid());
 126             testClhsdbForUniverse(app.getPid(), gc);
 127         } finally {
 128             LingeredApp.stopApp(app);
 129         }
 130     }
 131 
 132 
 133     public static void main (String... args) throws Exception {
 134 
 135         if (!Platform.shouldSAAttach()) {
 136             System.out.println(
 137                "SA attach not expected to work - test skipped.");
 138             return;
 139         }
 140 
 141         try {
 142             test("-XX:+UseG1GC");
 143             test("-XX:+UseParallelGC");
 144             test("-XX:+UseSerialGC");
 145             if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
 146               test("-XX:+UseConcMarkSweepGC");
 147             }
 148             test("-XX:+UseEpsilonGC");
 149         } catch (Exception e) {
 150             throw new Error("Test failed with " + e);
 151         }
 152     }
 153 }
< prev index next >