< prev index next >

test/hotspot/jtreg/gc/shenandoah/options/TestExplicitGC.java

Print this page
rev 59823 : 8247751: Shenandoah: options tests should run with smaller heaps
Reviewed-by: XXX


  44     }
  45 
  46     public static void main(String[] args) throws Exception {
  47         if (args.length > 0) {
  48             System.out.println("Calling System.gc()");
  49             System.gc();
  50             return;
  51         }
  52 
  53         String[] full = new String[] {
  54                 "Pause Full"
  55         };
  56 
  57         String[] concNormal = new String[] {
  58                 "Pause Init Mark",
  59                 "Pause Final Mark",
  60         };
  61 
  62         {
  63             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(

  64                     "-XX:+UnlockExperimentalVMOptions",
  65                     "-XX:+UseShenandoahGC",
  66                     "-Xlog:gc",
  67                     TestExplicitGC.class.getName(),
  68                     "test");
  69             OutputAnalyzer output = new OutputAnalyzer(pb.start());
  70             for (String p : full) {
  71                 output.shouldNotContain(p);
  72             }
  73             for (String p : concNormal) {
  74                 output.shouldContain(p);
  75             }
  76         }
  77 
  78         {
  79             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(

  80                     "-XX:+UnlockExperimentalVMOptions",
  81                     "-XX:+UseShenandoahGC",
  82                     "-Xlog:gc",
  83                     "-XX:+DisableExplicitGC",
  84                     TestExplicitGC.class.getName(),
  85                     "test");
  86             OutputAnalyzer output = new OutputAnalyzer(pb.start());
  87             for (String p : full) {
  88                 output.shouldNotContain(p);
  89             }
  90             for (String p : concNormal) {
  91                 output.shouldNotContain(p);
  92             }
  93         }
  94 
  95         {
  96             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(

  97                     "-XX:+UnlockExperimentalVMOptions",
  98                     "-XX:+UseShenandoahGC",
  99                     "-Xlog:gc",
 100                     "-XX:+ExplicitGCInvokesConcurrent",
 101                     TestExplicitGC.class.getName(),
 102                     "test");
 103             OutputAnalyzer output = new OutputAnalyzer(pb.start());
 104             for (String p : full) {
 105                 output.shouldNotContain(p);
 106             }
 107             for (String p : concNormal) {
 108                 output.shouldContain(p);
 109             }
 110         }
 111 
 112         {
 113             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(

 114                     "-XX:+UnlockExperimentalVMOptions",
 115                     "-XX:+UseShenandoahGC",
 116                     "-Xlog:gc",
 117                     "-XX:-ExplicitGCInvokesConcurrent",
 118                     TestExplicitGC.class.getName(),
 119                     "test");
 120             OutputAnalyzer output = new OutputAnalyzer(pb.start());
 121             for (String p : full) {
 122                 output.shouldContain(p);
 123             }
 124             for (String p : concNormal) {
 125                 output.shouldNotContain(p);
 126             }
 127         }
 128 
 129         {
 130             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(

 131                     "-XX:+UnlockExperimentalVMOptions",
 132                     "-XX:+UseShenandoahGC",
 133                     "-Xlog:gc",
 134                     "-XX:+ExplicitGCInvokesConcurrent",
 135                     "-XX:ShenandoahGCMode=iu",
 136                     TestExplicitGC.class.getName(),
 137                     "test");
 138             OutputAnalyzer output = new OutputAnalyzer(pb.start());
 139             for (String p : full) {
 140                 output.shouldNotContain(p);
 141             }
 142             for (String p : concNormal) {
 143                 output.shouldContain(p);
 144             }
 145          }
 146     }
 147 }


  44     }
  45 
  46     public static void main(String[] args) throws Exception {
  47         if (args.length > 0) {
  48             System.out.println("Calling System.gc()");
  49             System.gc();
  50             return;
  51         }
  52 
  53         String[] full = new String[] {
  54                 "Pause Full"
  55         };
  56 
  57         String[] concNormal = new String[] {
  58                 "Pause Init Mark",
  59                 "Pause Final Mark",
  60         };
  61 
  62         {
  63             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  64                     "-Xmx128m",
  65                     "-XX:+UnlockExperimentalVMOptions",
  66                     "-XX:+UseShenandoahGC",
  67                     "-Xlog:gc",
  68                     TestExplicitGC.class.getName(),
  69                     "test");
  70             OutputAnalyzer output = new OutputAnalyzer(pb.start());
  71             for (String p : full) {
  72                 output.shouldNotContain(p);
  73             }
  74             for (String p : concNormal) {
  75                 output.shouldContain(p);
  76             }
  77         }
  78 
  79         {
  80             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  81                     "-Xmx128m",
  82                     "-XX:+UnlockExperimentalVMOptions",
  83                     "-XX:+UseShenandoahGC",
  84                     "-Xlog:gc",
  85                     "-XX:+DisableExplicitGC",
  86                     TestExplicitGC.class.getName(),
  87                     "test");
  88             OutputAnalyzer output = new OutputAnalyzer(pb.start());
  89             for (String p : full) {
  90                 output.shouldNotContain(p);
  91             }
  92             for (String p : concNormal) {
  93                 output.shouldNotContain(p);
  94             }
  95         }
  96 
  97         {
  98             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  99                     "-Xmx128m",
 100                     "-XX:+UnlockExperimentalVMOptions",
 101                     "-XX:+UseShenandoahGC",
 102                     "-Xlog:gc",
 103                     "-XX:+ExplicitGCInvokesConcurrent",
 104                     TestExplicitGC.class.getName(),
 105                     "test");
 106             OutputAnalyzer output = new OutputAnalyzer(pb.start());
 107             for (String p : full) {
 108                 output.shouldNotContain(p);
 109             }
 110             for (String p : concNormal) {
 111                 output.shouldContain(p);
 112             }
 113         }
 114 
 115         {
 116             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
 117                     "-Xmx128m",
 118                     "-XX:+UnlockExperimentalVMOptions",
 119                     "-XX:+UseShenandoahGC",
 120                     "-Xlog:gc",
 121                     "-XX:-ExplicitGCInvokesConcurrent",
 122                     TestExplicitGC.class.getName(),
 123                     "test");
 124             OutputAnalyzer output = new OutputAnalyzer(pb.start());
 125             for (String p : full) {
 126                 output.shouldContain(p);
 127             }
 128             for (String p : concNormal) {
 129                 output.shouldNotContain(p);
 130             }
 131         }
 132 
 133         {
 134             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
 135                     "-Xmx128m",
 136                     "-XX:+UnlockExperimentalVMOptions",
 137                     "-XX:+UseShenandoahGC",
 138                     "-Xlog:gc",
 139                     "-XX:+ExplicitGCInvokesConcurrent",
 140                     "-XX:ShenandoahGCMode=iu",
 141                     TestExplicitGC.class.getName(),
 142                     "test");
 143             OutputAnalyzer output = new OutputAnalyzer(pb.start());
 144             for (String p : full) {
 145                 output.shouldNotContain(p);
 146             }
 147             for (String p : concNormal) {
 148                 output.shouldContain(p);
 149             }
 150          }
 151     }
 152 }
< prev index next >