test/gc/g1/TestGCLogMessages.java

Print this page
rev 5920 : 8035406: Improve data structure for Code Cache remembered sets
Summary: Change the code cache remembered sets data structure from a GrowableArray to a chunked list of nmethods. This makes the data structure more amenable to parallelization, and decreases freeing time.
Reviewed-by:
rev 5921 : 8027295: Free CSet takes ~50% of young pause time
Summary: Improve fast card cache iteration and avoid taking locks when freeing the collection set.
Reviewed-by:

@@ -21,11 +21,11 @@
  * questions.
  */
 
 /*
  * @test TestPrintGCDetails
- * @bug 8035406
+ * @bug 8035406 8027295
  * @summary Ensure that the PrintGCDetails output for a minor GC with G1
  * includes the expected necessary messages.
  * @key gc
  * @library /testlibrary
  */

@@ -36,17 +36,45 @@
 public class TestGCLogMessages {
   public static void main(String[] args) throws Exception {
 
     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
                                                               "-Xmx10M",
-                                                              "-XX:+PrintGCDetails",
                                                               GCTest.class.getName());
 
     OutputAnalyzer output = new OutputAnalyzer(pb.start());
 
+    output.shouldNotContain("[Code Root Purge");
+    output.shouldNotContain("[Young Free CSet");
+    output.shouldNotContain("[Non-Young Free CSet");
+    output.shouldHaveExitValue(0);
+
+    pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+                                                              "-Xmx10M",
+                                                              "-XX:+PrintGCDetails",
+                                                              GCTest.class.getName());
+
+    output = new OutputAnalyzer(pb.start());
+
     output.shouldContain("[Code Root Purge");
+    output.shouldNotContain("[Young Free CSet");
+    output.shouldNotContain("[Non-Young Free CSet");
     output.shouldHaveExitValue(0);
+
+    pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+                                                              "-Xmx10M",
+                                                              "-XX:+PrintGCDetails",
+                                                              "-XX:+UnlockExperimentalVMOptions",
+                                                              "-XX:G1LogLevel=finest",
+                                                              GCTest.class.getName());
+
+    output = new OutputAnalyzer(pb.start());
+
+    output.shouldContain("[Code Root Purge");
+    output.shouldContain("[Young Free CSet");
+    output.shouldContain("[Non-Young Free CSet");
+    output.shouldHaveExitValue(0);
+
   }
 
   static class GCTest {
     private static byte[] garbage;
     public static void main(String [] args) {