< prev index next >
test/gc/g1/TestStringDeduplicationTools.java
Print this page
*** 302,315 ****
System.out.println("End: InternedTest");
}
public static OutputAnalyzer run() throws Exception {
! return runTest("-XX:+PrintGC",
! "-XX:+PrintGCDetails",
"-XX:+UseStringDeduplication",
- "-XX:+PrintStringDeduplicationStatistics",
"-XX:StringDeduplicationAgeThreshold=" + DefaultAgeThreshold,
InternedTest.class.getName(),
"" + DefaultAgeThreshold);
}
}
--- 302,313 ----
System.out.println("End: InternedTest");
}
public static OutputAnalyzer run() throws Exception {
! return runTest("-Xlog:gc=debug,gc+stringdedup=trace",
"-XX:+UseStringDeduplication",
"-XX:StringDeduplicationAgeThreshold=" + DefaultAgeThreshold,
InternedTest.class.getName(),
"" + DefaultAgeThreshold);
}
}
*** 331,386 ****
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");
output.shouldNotContain("Full GC");
! output.shouldContain("GC pause (G1 Evacuation Pause) (young)");
! output.shouldContain("GC 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)");
output.shouldContain("Full GC");
! output.shouldContain("GC 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",
"-XX:+StringDeduplicationResizeALot");
! output.shouldContain("GC 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",
"-XX:+StringDeduplicationRehashALot");
! output.shouldContain("GC concurrent-string-deduplication");
output.shouldContain("Deduplicated:");
output.shouldNotContain("Rehash Count: 0");
output.shouldNotContain("Hash Seed: 0x0");
output.shouldHaveExitValue(0);
}
--- 329,380 ----
public static void testYoungGC() throws Exception {
// Do young GC to age strings to provoke deduplication
OutputAnalyzer output = DeduplicationTest.run(LargeNumberOfStrings,
DefaultAgeThreshold,
YoungGC,
! "-Xlog:gc,gc+stringdedup=trace");
output.shouldNotContain("Full GC");
! 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,
! "-Xlog:gc,gc+stringdedup=trace");
! output.shouldNotContain("Pause Young (G1 Evacuation Pause)");
output.shouldContain("Full GC");
! 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,
! "-Xlog:gc,gc+stringdedup=trace",
"-XX:+StringDeduplicationResizeALot");
! 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,
! "-Xlog:gc,gc+stringdedup=trace",
"-XX:+StringDeduplicationRehashALot");
! output.shouldContain("Concurrent String Deduplication");
output.shouldContain("Deduplicated:");
output.shouldNotContain("Rehash Count: 0");
output.shouldNotContain("Hash Seed: 0x0");
output.shouldHaveExitValue(0);
}
*** 390,412 ****
// Test with max age theshold
output = DeduplicationTest.run(SmallNumberOfStrings,
MaxAgeThreshold,
YoungGC,
! "-XX:+PrintGC",
! "-XX:+PrintStringDeduplicationStatistics");
! output.shouldContain("GC 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");
output.shouldContain("Deduplicated:");
output.shouldHaveExitValue(0);
// Test with too low age threshold
output = DeduplicationTest.run(SmallNumberOfStrings,
--- 384,404 ----
// Test with max age theshold
output = DeduplicationTest.run(SmallNumberOfStrings,
MaxAgeThreshold,
YoungGC,
! "-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,
! "-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,447 ****
}
public static void testPrintOptions() throws Exception {
OutputAnalyzer output;
! // Test without PrintGC and without PrintStringDeduplicationStatistics
output = DeduplicationTest.run(SmallNumberOfStrings,
DefaultAgeThreshold,
YoungGC);
! output.shouldNotContain("GC concurrent-string-deduplication");
output.shouldNotContain("Deduplicated:");
output.shouldHaveExitValue(0);
! // Test with PrintGC but without PrintStringDeduplicationStatistics
output = DeduplicationTest.run(SmallNumberOfStrings,
DefaultAgeThreshold,
YoungGC,
! "-XX:+PrintGC");
! output.shouldContain("GC concurrent-string-deduplication");
output.shouldNotContain("Deduplicated:");
output.shouldHaveExitValue(0);
}
public static void testInterned() throws Exception {
--- 416,439 ----
}
public static void testPrintOptions() throws Exception {
OutputAnalyzer output;
! // Test without -Xlog:gc
output = DeduplicationTest.run(SmallNumberOfStrings,
DefaultAgeThreshold,
YoungGC);
! output.shouldNotContain("Concurrent String Deduplication");
output.shouldNotContain("Deduplicated:");
output.shouldHaveExitValue(0);
! // Test with -Xlog:gc+stringdedup
output = DeduplicationTest.run(SmallNumberOfStrings,
DefaultAgeThreshold,
YoungGC,
! "-Xlog:gc+stringdedup");
! output.shouldContain("Concurrent String Deduplication");
output.shouldNotContain("Deduplicated:");
output.shouldHaveExitValue(0);
}
public static void testInterned() throws Exception {
< prev index next >