< prev index next >
test/gc/shenandoah/TestPeriodicGC.java
Print this page
rev 10604 : [backport] Comprehensible GC trigger logging
*** 41,54 ****
cmds[args.length + 1] = "test";
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmds);
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldHaveExitValue(0);
! if (periodic && !output.getOutput().contains("Periodic GC")) {
throw new AssertionError(msg + ": Should have periodic GC in logs");
}
! if (!periodic && output.getOutput().contains("Periodic GC")) {
throw new AssertionError(msg + ": Should not have periodic GC in logs");
}
}
public static void main(String[] args) throws Exception {
--- 41,54 ----
cmds[args.length + 1] = "test";
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmds);
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldHaveExitValue(0);
! if (periodic && !output.getOutput().contains("Trigger: Time since last GC")) {
throw new AssertionError(msg + ": Should have periodic GC in logs");
}
! if (!periodic && output.getOutput().contains("Trigger: Time since last GC")) {
throw new AssertionError(msg + ": Should not have periodic GC in logs");
}
}
public static void main(String[] args) throws Exception {
*** 69,89 ****
};
for (String h : enabled) {
testWith("Short period with " + h,
true,
! "-XX:+PrintGCDetails",
"-XX:+UseShenandoahGC",
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+UnlockExperimentalVMOptions",
"-XX:ShenandoahGCHeuristics=" + h,
"-XX:ShenandoahGuaranteedGCInterval=1000"
);
testWith("Long period with " + h,
false,
! "-XX:+PrintGCDetails",
"-XX:+UseShenandoahGC",
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+UnlockExperimentalVMOptions",
"-XX:ShenandoahGCHeuristics=" + h,
"-XX:ShenandoahGuaranteedGCInterval=100000" // deliberately too long
--- 69,89 ----
};
for (String h : enabled) {
testWith("Short period with " + h,
true,
! "-verbose:gc",
"-XX:+UseShenandoahGC",
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+UnlockExperimentalVMOptions",
"-XX:ShenandoahGCHeuristics=" + h,
"-XX:ShenandoahGuaranteedGCInterval=1000"
);
testWith("Long period with " + h,
false,
! "-verbose:gc",
"-XX:+UseShenandoahGC",
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+UnlockExperimentalVMOptions",
"-XX:ShenandoahGCHeuristics=" + h,
"-XX:ShenandoahGuaranteedGCInterval=100000" // deliberately too long
*** 91,101 ****
}
for (String h : disabled) {
testWith("Short period with " + h,
false,
! "-XX:+PrintGCDetails",
"-XX:+UseShenandoahGC",
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+UnlockExperimentalVMOptions",
"-XX:ShenandoahGCHeuristics=" + h,
"-XX:ShenandoahGuaranteedGCInterval=1000"
--- 91,101 ----
}
for (String h : disabled) {
testWith("Short period with " + h,
false,
! "-verbose:gc",
"-XX:+UseShenandoahGC",
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+UnlockExperimentalVMOptions",
"-XX:ShenandoahGCHeuristics=" + h,
"-XX:ShenandoahGuaranteedGCInterval=1000"
< prev index next >