242 }
243
244 LogMessageWithLevel concRefineMessages[] = new LogMessageWithLevel[] {
245 new LogMessageWithLevel("Mutator refinement: ", Level.DEBUG),
246 new LogMessageWithLevel("Concurrent refinement: ", Level.DEBUG),
247 new LogMessageWithLevel("Total refinement: ", Level.DEBUG),
248 // "Concurrent refinement rate" optionally printed if any.
249 // "Generate dirty cards rate" optionally printed if any.
250 };
251
252 private void testConcurrentRefinementLogs() throws Exception {
253 OutputAnalyzer output = ProcessTools.executeLimitedTestJava("-XX:+UseG1GC",
254 "-Xmx10M",
255 "-Xlog:gc+refine+stats=debug",
256 GCTest.class.getName());
257 checkMessagesAtLevel(output, concRefineMessages, Level.DEBUG);
258 }
259
260 LogMessageWithLevel exhFailureMessages[] = new LogMessageWithLevel[] {
261 new LogMessageWithLevel("Recalculate Used Memory \\(ms\\):", Level.DEBUG),
262 new LogMessageWithLevel("Restore Preserved Marks \\(ms\\):", Level.DEBUG),
263 new LogMessageWithLevel("Restore Evacuation Failed Regions \\(ms\\):", Level.DEBUG),
264 new LogMessageWithLevel("Process Evacuation Failed Regions \\(ms\\):", Level.DEBUG),
265 new LogMessageWithLevel("Evacuation Failed Regions:", Level.DEBUG),
266 new LogMessageWithLevel("Pinned Regions:", Level.DEBUG),
267 new LogMessageWithLevel("Allocation Failed Regions:", Level.DEBUG),
268 };
269
270 private void testWithEvacuationFailureLogs() throws Exception {
271 OutputAnalyzer output = ProcessTools.executeLimitedTestJava("-XX:+UseG1GC",
272 "-Xmx32M",
273 "-Xmn16M",
274 "-XX:+G1GCAllocationFailureALot",
275 "-XX:G1GCAllocationFailureALotCount=100",
276 "-XX:G1GCAllocationFailureALotInterval=1",
277 "-XX:+UnlockDiagnosticVMOptions",
278 "-Xlog:gc+phases=debug",
279 GCTestWithAllocationFailure.class.getName());
280
281 checkMessagesAtLevel(output, exhFailureMessages, Level.DEBUG);
282 output.shouldHaveExitValue(0);
|
242 }
243
244 LogMessageWithLevel concRefineMessages[] = new LogMessageWithLevel[] {
245 new LogMessageWithLevel("Mutator refinement: ", Level.DEBUG),
246 new LogMessageWithLevel("Concurrent refinement: ", Level.DEBUG),
247 new LogMessageWithLevel("Total refinement: ", Level.DEBUG),
248 // "Concurrent refinement rate" optionally printed if any.
249 // "Generate dirty cards rate" optionally printed if any.
250 };
251
252 private void testConcurrentRefinementLogs() throws Exception {
253 OutputAnalyzer output = ProcessTools.executeLimitedTestJava("-XX:+UseG1GC",
254 "-Xmx10M",
255 "-Xlog:gc+refine+stats=debug",
256 GCTest.class.getName());
257 checkMessagesAtLevel(output, concRefineMessages, Level.DEBUG);
258 }
259
260 LogMessageWithLevel exhFailureMessages[] = new LogMessageWithLevel[] {
261 new LogMessageWithLevel("Recalculate Used Memory \\(ms\\):", Level.DEBUG),
262 new LogMessageWithLevel("Restore Evacuation Failed Regions \\(ms\\):", Level.DEBUG),
263 new LogMessageWithLevel("Process Evacuation Failed Regions \\(ms\\):", Level.DEBUG),
264 new LogMessageWithLevel("Evacuation Failed Regions:", Level.DEBUG),
265 new LogMessageWithLevel("Pinned Regions:", Level.DEBUG),
266 new LogMessageWithLevel("Allocation Failed Regions:", Level.DEBUG),
267 };
268
269 private void testWithEvacuationFailureLogs() throws Exception {
270 OutputAnalyzer output = ProcessTools.executeLimitedTestJava("-XX:+UseG1GC",
271 "-Xmx32M",
272 "-Xmn16M",
273 "-XX:+G1GCAllocationFailureALot",
274 "-XX:G1GCAllocationFailureALotCount=100",
275 "-XX:G1GCAllocationFailureALotInterval=1",
276 "-XX:+UnlockDiagnosticVMOptions",
277 "-Xlog:gc+phases=debug",
278 GCTestWithAllocationFailure.class.getName());
279
280 checkMessagesAtLevel(output, exhFailureMessages, Level.DEBUG);
281 output.shouldHaveExitValue(0);
|