< prev index next >

test/gc/g1/TestStringDeduplicationTools.java

Print this page

        

@@ -302,14 +302,12 @@
 
             System.out.println("End: InternedTest");
         }
 
         public static OutputAnalyzer run() throws Exception {
-            return runTest("-XX:+PrintGC",
-                           "-XX:+PrintGCDetails",
+            return runTest("-Xlog:gc=debug,gc+stringdedup=trace",
                            "-XX:+UseStringDeduplication",
-                           "-XX:+PrintStringDeduplicationStatistics",
                            "-XX:StringDeduplicationAgeThreshold=" + DefaultAgeThreshold,
                            InternedTest.class.getName(),
                            "" + DefaultAgeThreshold);
         }
     }

@@ -331,56 +329,52 @@
     public static void testYoungGC() throws Exception {
         // Do young GC to age strings to provoke deduplication
         OutputAnalyzer output = DeduplicationTest.run(LargeNumberOfStrings,
                                                       DefaultAgeThreshold,
                                                       YoungGC,
-                                                      "-XX:+PrintGC",
-                                                      "-XX:+PrintStringDeduplicationStatistics");
+                                                      "-Xlog:gc,gc+stringdedup=trace");
         output.shouldNotContain("Full GC");
-        output.shouldContain("GC pause (G1 Evacuation Pause) (young)");
-        output.shouldContain("GC concurrent-string-deduplication");
+        output.shouldContain("Pause Young (G1 Evacuation Pause)");
+        output.shouldContain("Concurrent String Deduplication");
         output.shouldContain("Deduplicated:");
         output.shouldHaveExitValue(0);
     }
 
     public static void testFullGC() throws Exception {
         // Do full GC to age strings to provoke deduplication
         OutputAnalyzer output = DeduplicationTest.run(LargeNumberOfStrings,
                                                       DefaultAgeThreshold,
                                                       FullGC,
-                                                      "-XX:+PrintGC",
-                                                      "-XX:+PrintStringDeduplicationStatistics");
-        output.shouldNotContain("GC pause (G1 Evacuation Pause) (young)");
+                                                      "-Xlog:gc,gc+stringdedup=trace");
+        output.shouldNotContain("Pause Young (G1 Evacuation Pause)");
         output.shouldContain("Full GC");
-        output.shouldContain("GC concurrent-string-deduplication");
+        output.shouldContain("Concurrent String Deduplication");
         output.shouldContain("Deduplicated:");
         output.shouldHaveExitValue(0);
     }
 
     public static void testTableResize() throws Exception {
         // Test with StringDeduplicationResizeALot
         OutputAnalyzer output = DeduplicationTest.run(LargeNumberOfStrings,
                                                       DefaultAgeThreshold,
                                                       YoungGC,
-                                                      "-XX:+PrintGC",
-                                                      "-XX:+PrintStringDeduplicationStatistics",
+                                                      "-Xlog:gc,gc+stringdedup=trace",
                                                       "-XX:+StringDeduplicationResizeALot");
-        output.shouldContain("GC concurrent-string-deduplication");
+        output.shouldContain("Concurrent String Deduplication");
         output.shouldContain("Deduplicated:");
         output.shouldNotContain("Resize Count: 0");
         output.shouldHaveExitValue(0);
     }
 
     public static void testTableRehash() throws Exception {
         // Test with StringDeduplicationRehashALot
         OutputAnalyzer output = DeduplicationTest.run(LargeNumberOfStrings,
                                                       DefaultAgeThreshold,
                                                       YoungGC,
-                                                      "-XX:+PrintGC",
-                                                      "-XX:+PrintStringDeduplicationStatistics",
+                                                      "-Xlog:gc,gc+stringdedup=trace",
                                                       "-XX:+StringDeduplicationRehashALot");
-        output.shouldContain("GC concurrent-string-deduplication");
+        output.shouldContain("Concurrent String Deduplication");
         output.shouldContain("Deduplicated:");
         output.shouldNotContain("Rehash Count: 0");
         output.shouldNotContain("Hash Seed: 0x0");
         output.shouldHaveExitValue(0);
     }

@@ -390,23 +384,21 @@
 
         // Test with max age theshold
         output = DeduplicationTest.run(SmallNumberOfStrings,
                                        MaxAgeThreshold,
                                        YoungGC,
-                                       "-XX:+PrintGC",
-                                       "-XX:+PrintStringDeduplicationStatistics");
-        output.shouldContain("GC concurrent-string-deduplication");
+                                       "-Xlog:gc,gc+stringdedup=trace");
+        output.shouldContain("Concurrent String Deduplication");
         output.shouldContain("Deduplicated:");
         output.shouldHaveExitValue(0);
 
         // Test with min age theshold
         output = DeduplicationTest.run(SmallNumberOfStrings,
                                        MinAgeThreshold,
                                        YoungGC,
-                                       "-XX:+PrintGC",
-                                       "-XX:+PrintStringDeduplicationStatistics");
-        output.shouldContain("GC concurrent-string-deduplication");
+                                       "-Xlog:gc,gc+stringdedup=trace");
+        output.shouldContain("Concurrent String Deduplication");
         output.shouldContain("Deduplicated:");
         output.shouldHaveExitValue(0);
 
         // Test with too low age threshold
         output = DeduplicationTest.run(SmallNumberOfStrings,

@@ -424,24 +416,24 @@
     }
 
     public static void testPrintOptions() throws Exception {
         OutputAnalyzer output;
 
-        // Test without PrintGC and without PrintStringDeduplicationStatistics
+        // Test without -Xlog:gc
         output = DeduplicationTest.run(SmallNumberOfStrings,
                                        DefaultAgeThreshold,
                                        YoungGC);
-        output.shouldNotContain("GC concurrent-string-deduplication");
+        output.shouldNotContain("Concurrent String Deduplication");
         output.shouldNotContain("Deduplicated:");
         output.shouldHaveExitValue(0);
 
-        // Test with PrintGC but without PrintStringDeduplicationStatistics
+        // Test with -Xlog:gc+stringdedup
         output = DeduplicationTest.run(SmallNumberOfStrings,
                                        DefaultAgeThreshold,
                                        YoungGC,
-                                       "-XX:+PrintGC");
-        output.shouldContain("GC concurrent-string-deduplication");
+                                       "-Xlog:gc+stringdedup");
+        output.shouldContain("Concurrent String Deduplication");
         output.shouldNotContain("Deduplicated:");
         output.shouldHaveExitValue(0);
     }
 
     public static void testInterned() throws Exception {
< prev index next >