< prev index next >

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

Print this page




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





 106     }
 107 
 108     public static void test(String gc) throws Exception {
 109         LingeredApp app = null;
 110         try {
 111             List<String> vmArgs = new ArrayList<String>();

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

 136         } catch (Exception e) {
 137             throw new Error("Test failed with " + e);
 138         }
 139     }
 140 }


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