< prev index next >

test/hotspot/jtreg/runtime/cds/appcds/TestParallelGCWithCDS.java

Print this page

100                 "2m",   // usually this will fail to load the archived heap, but app can launch
101                         // or fail with "GC triggered before VM initialization completed"
102                 "1m"    // usually this will cause VM launch to fail with "Too small maximum heap"
103             };
104             for (String sz : sizes) {
105                 String xmx = "-Xmx" + sz;
106                 System.out.println("=======\n" + n + ". Exec with " + execGC + " " + xmx);
107                 out = TestCommon.exec(helloJar,
108                                       execGC,
109                                       small1,
110                                       small2,
111                                       xmx,
112                                       "-Xlog:cds",
113                                       "Hello");
114                 if (out.getExitValue() == 0) {
115                     out.shouldContain(HELLO);
116                 } else {
117                     String pattern = "((Too small maximum heap)" +
118                                      "|(GC triggered before VM initialization completed)" +
119                                      "|(java.lang.OutOfMemoryError: Java heap space)" +

120                                      "|(Initial heap size set to a larger value than the maximum heap size))";
121                     out.shouldMatch(pattern);
122                     out.shouldNotHaveFatalError();
123                 }
124                 n++;
125             }
126         }
127     }
128 }

100                 "2m",   // usually this will fail to load the archived heap, but app can launch
101                         // or fail with "GC triggered before VM initialization completed"
102                 "1m"    // usually this will cause VM launch to fail with "Too small maximum heap"
103             };
104             for (String sz : sizes) {
105                 String xmx = "-Xmx" + sz;
106                 System.out.println("=======\n" + n + ". Exec with " + execGC + " " + xmx);
107                 out = TestCommon.exec(helloJar,
108                                       execGC,
109                                       small1,
110                                       small2,
111                                       xmx,
112                                       "-Xlog:cds",
113                                       "Hello");
114                 if (out.getExitValue() == 0) {
115                     out.shouldContain(HELLO);
116                 } else {
117                     String pattern = "((Too small maximum heap)" +
118                                      "|(GC triggered before VM initialization completed)" +
119                                      "|(java.lang.OutOfMemoryError: Java heap space)" +
120                                      "|(CDS archive has aot-linked classes but the archived heap objects cannot be loaded)" +
121                                      "|(Initial heap size set to a larger value than the maximum heap size))";
122                     out.shouldMatch(pattern);
123                     out.shouldNotHaveFatalError();
124                 }
125                 n++;
126             }
127         }
128     }
129 }
< prev index next >