< prev index next >
test/gc/g1/TestRemsetLoggingThreads.java
Print this page
*** 20,30 ****
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
! * @test TestSummarizeRSetStatsThreads
* @bug 8025441
* @summary Ensure that various values of worker threads/concurrent
* refinement threads do not crash the VM.
* @key gc
* @library /testlibrary
--- 20,30 ----
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
! * @test TestRemsetLoggingThreads
* @bug 8025441
* @summary Ensure that various values of worker threads/concurrent
* refinement threads do not crash the VM.
* @key gc
* @library /testlibrary
*** 36,79 ****
import java.util.regex.Pattern;
import jdk.test.lib.ProcessTools;
import jdk.test.lib.OutputAnalyzer;
! public class TestSummarizeRSetStatsThreads {
private static void runTest(int refinementThreads, int workerThreads) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
"-XX:+UnlockDiagnosticVMOptions",
! "-XX:+G1SummarizeRSetStats",
"-XX:G1ConcRefinementThreads=" + refinementThreads,
"-XX:ParallelGCThreads=" + workerThreads,
"-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
- // check output to contain the string "Concurrent RS threads times (s)" followed by
- // the correct number of values in the next line.
-
// a zero in refinement thread numbers indicates that the value in ParallelGCThreads should be used.
// Additionally use at least one thread.
int expectedNumRefinementThreads = refinementThreads;
! // create the pattern made up of n copies of a floating point number pattern
! String numberPattern = String.format("%0" + expectedNumRefinementThreads + "d", 0)
! .replace("0", "\\s+\\d+\\.\\d+");
! String pattern = "Concurrent RS threads times \\(s\\)$" + numberPattern + "$";
Matcher m = Pattern.compile(pattern, Pattern.MULTILINE).matcher(output.getStdout());
if (!m.find()) {
throw new Exception("Could not find correct output for concurrent RS threads times in stdout," +
" should match the pattern \"" + pattern + "\", but stdout is \n" + output.getStdout());
}
output.shouldHaveExitValue(0);
}
public static void main(String[] args) throws Exception {
! if (!TestSummarizeRSetStatsTools.testingG1GC()) {
return;
}
// different valid combinations of number of refinement and gc worker threads
runTest(1, 1);
runTest(1, 5);
--- 36,73 ----
import java.util.regex.Pattern;
import jdk.test.lib.ProcessTools;
import jdk.test.lib.OutputAnalyzer;
! public class TestRemsetLoggingThreads {
private static void runTest(int refinementThreads, int workerThreads) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
"-XX:+UnlockDiagnosticVMOptions",
! "-Xlog:gc+remset+exit=trace",
"-XX:G1ConcRefinementThreads=" + refinementThreads,
"-XX:ParallelGCThreads=" + workerThreads,
"-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
// a zero in refinement thread numbers indicates that the value in ParallelGCThreads should be used.
// Additionally use at least one thread.
int expectedNumRefinementThreads = refinementThreads;
! String pattern = "Concurrent RS threads times \\(s\\)$";
Matcher m = Pattern.compile(pattern, Pattern.MULTILINE).matcher(output.getStdout());
if (!m.find()) {
throw new Exception("Could not find correct output for concurrent RS threads times in stdout," +
" should match the pattern \"" + pattern + "\", but stdout is \n" + output.getStdout());
}
output.shouldHaveExitValue(0);
}
public static void main(String[] args) throws Exception {
! if (!TestRemsetLoggingTools.testingG1GC()) {
return;
}
// different valid combinations of number of refinement and gc worker threads
runTest(1, 1);
runTest(1, 5);
< prev index next >