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 "|(Initial heap size set to a larger value than the maximum heap size)" +
120 "|(java.lang.OutOfMemoryError)" +
121 "|(Error: A JNI error has occurred, please check your installation and try again))";
122 out.shouldMatch(pattern);
123 out.shouldNotHaveFatalError();
124 }
125 n++;
126 }
127 }
128 }
129 }
|
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 "|(Initial heap size set to a larger value than the maximum heap size)" +
120 "|(CDS archive has aot-linked classes but the archived heap objects cannot be loaded)" +
121 "|(java.lang.OutOfMemoryError)" +
122 "|(Error: A JNI error has occurred, please check your installation and try again))";
123 out.shouldMatch(pattern);
124 out.shouldNotHaveFatalError();
125 }
126 n++;
127 }
128 }
129 }
130 }
|