< prev index next >
./b8448a4717da.export
Print this page
@@ -328,16 +328,16 @@
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/*
* @test TestGCLogMessages
-- * @bug 8035406 8027295 8035398 8019342 8027959 8048179
-+ * @bug 8035406 8027295 8035398 8019342 8027959 8048179 8027962
+- * @bug 8035406 8027295 8035398 8019342 8027959
++ * @bug 8035406 8027295 8035398 8019342 8027959 8027962
* @summary Ensure that the PrintGCDetails output for a minor GC with G1
* includes the expected necessary messages.
* @key gc
-@@ -34,131 +34,159 @@
+@@ -34,128 +34,158 @@
import com.oracle.java.testlibrary.OutputAnalyzer;
public class TestGCLogMessages {
- public static void main(String[] args) throws Exception {
- testNormalLogs();
@@ -371,11 +371,10 @@
- output.shouldNotContain("[Redirtied Cards");
- output.shouldNotContain("[Code Root Purge");
- output.shouldNotContain("[String Dedup Fixup");
- output.shouldNotContain("[Young Free CSet");
- output.shouldNotContain("[Non-Young Free CSet");
-- output.shouldNotContain("[Humongous Register");
- output.shouldNotContain("[Humongous Reclaim");
- output.shouldHaveExitValue(0);
+ private LogMessageWithLevel allLogMessages[] = new LogMessageWithLevel[] {
+ // Ext Root Scan
+ new LogMessageWithLevel("Thread Roots (ms)", Level.FINEST),
@@ -403,11 +402,10 @@
+ // Free CSet
+ new LogMessageWithLevel("Young Free CSet", Level.FINEST),
+ new LogMessageWithLevel("Non-Young Free CSet", Level.FINEST),
+ // Humongous Eager Reclaim
+ new LogMessageWithLevel("Humongous Reclaim", Level.FINER),
-+ new LogMessageWithLevel("Humongous Register", Level.FINER),
+ };
- pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
- "-XX:+UseStringDeduplication",
- "-Xmx10M",
@@ -434,14 +432,13 @@
- output.shouldNotContain("[Redirtied Cards");
- output.shouldContain("[Code Root Purge");
- output.shouldContain("[String Dedup Fixup");
- output.shouldNotContain("[Young Free CSet");
- output.shouldNotContain("[Non-Young Free CSet");
-- output.shouldContain("[Humongous Register");
+- output.shouldContain("[Humongous Reclaim");
- output.shouldNotContain("[Humongous Total");
- output.shouldNotContain("[Humongous Candidate");
-- output.shouldContain("[Humongous Reclaim");
- output.shouldNotContain("[Humongous Reclaimed");
- output.shouldHaveExitValue(0);
+ private void testNormalLogs() throws Exception {
- pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
@@ -465,14 +462,13 @@
- output.shouldContain("[Redirtied Cards");
- output.shouldContain("[Code Root Purge");
- output.shouldContain("[String Dedup Fixup");
- output.shouldContain("[Young Free CSet");
- output.shouldContain("[Non-Young Free CSet");
-- output.shouldContain("[Humongous Register");
+- output.shouldContain("[Humongous Reclaim");
- output.shouldContain("[Humongous Total");
- output.shouldContain("[Humongous Candidate");
-- output.shouldContain("[Humongous Reclaim");
- output.shouldContain("[Humongous Reclaimed");
- output.shouldHaveExitValue(0);
- }
+ pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+ "-XX:+UseStringDeduplication",
@@ -480,12 +476,12 @@
+ "-XX:+PrintGCDetails",
+ GCTest.class.getName());
- private static void testWithToSpaceExhaustionLogs() throws Exception {
- ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
-- "-Xmx32M",
-- "-Xmn16M",
+- "-Xmx10M",
+- "-Xmn5M",
- "-XX:+PrintGCDetails",
- GCTestWithToSpaceExhaustion.class.getName());
+ output = new OutputAnalyzer(pb.start());
+ checkMessagesAtLevel(output, allLogMessages, Level.FINER);
@@ -502,12 +498,12 @@
+ "-XX:+UnlockExperimentalVMOptions",
+ "-XX:G1LogLevel=finest",
+ GCTest.class.getName());
- pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
-- "-Xmx32M",
-- "-Xmn16M",
+- "-Xmx10M",
+- "-Xmn5M",
- "-XX:+PrintGCDetails",
- "-XX:+UnlockExperimentalVMOptions",
- "-XX:G1LogLevel=finest",
- GCTestWithToSpaceExhaustion.class.getName());
+ output = new OutputAnalyzer(pb.start());
@@ -565,11 +561,11 @@
- static class GCTestWithToSpaceExhaustion {
- private static byte[] garbage;
- private static byte[] largeObject;
- public static void main(String [] args) {
-- largeObject = new byte[16*1024*1024];
+- largeObject = new byte[5*1024*1024];
- System.out.println("Creating garbage");
- // create 128MB of garbage. This should result in at least one GC,
- // some of them with to-space exhaustion.
- for (int i = 0; i < 1024; i++) {
- garbage = new byte[128 * 1024];
< prev index next >