Merge
This commit is contained in:
commit
8a03d57f9b
@ -1535,7 +1535,11 @@ void Arguments::select_gc_ergonomically() {
|
|||||||
if (should_auto_select_low_pause_collector()) {
|
if (should_auto_select_low_pause_collector()) {
|
||||||
FLAG_SET_ERGO(bool, UseConcMarkSweepGC, true);
|
FLAG_SET_ERGO(bool, UseConcMarkSweepGC, true);
|
||||||
} else {
|
} else {
|
||||||
|
#if defined(JAVASE_EMBEDDED)
|
||||||
FLAG_SET_ERGO(bool, UseParallelGC, true);
|
FLAG_SET_ERGO(bool, UseParallelGC, true);
|
||||||
|
#else
|
||||||
|
FLAG_SET_ERGO(bool, UseG1GC, true);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
FLAG_SET_ERGO(bool, UseSerialGC, true);
|
FLAG_SET_ERGO(bool, UseSerialGC, true);
|
||||||
|
@ -36,11 +36,6 @@ import jdk.test.lib.*;
|
|||||||
import java.util.regex.*;
|
import java.util.regex.*;
|
||||||
|
|
||||||
public class TestSelectDefaultGC {
|
public class TestSelectDefaultGC {
|
||||||
public static boolean versionStringContains(OutputAnalyzer output, String pattern) {
|
|
||||||
Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(output.getStderr());
|
|
||||||
return matcher.find();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void assertVMOption(OutputAnalyzer output, String option, boolean value) {
|
public static void assertVMOption(OutputAnalyzer output, String option, boolean value) {
|
||||||
output.shouldMatch(" " + option + " .*=.* " + value + " ");
|
output.shouldMatch(" " + option + " .*=.* " + value + " ");
|
||||||
}
|
}
|
||||||
@ -51,14 +46,18 @@ public class TestSelectDefaultGC {
|
|||||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||||
output.shouldHaveExitValue(0);
|
output.shouldHaveExitValue(0);
|
||||||
|
|
||||||
boolean isServerVM = versionStringContains(output, "Server VM");
|
boolean isServerVM = Platform.isServer();
|
||||||
|
boolean isEmbeddedVM = Platform.isEmbedded();
|
||||||
|
|
||||||
// Verify GC selection
|
// Verify GC selection
|
||||||
assertVMOption(output, "UseParallelGC", isServerVM);
|
// G1 is default for non-embedded server VMs
|
||||||
assertVMOption(output, "UseParallelOldGC", isServerVM);
|
assertVMOption(output, "UseG1GC", isServerVM && !isEmbeddedVM);
|
||||||
|
// Parallel is default for embedded server VMs
|
||||||
|
assertVMOption(output, "UseParallelGC", isServerVM && isEmbeddedVM);
|
||||||
|
assertVMOption(output, "UseParallelOldGC", isServerVM && isEmbeddedVM);
|
||||||
|
// Serial is default for non-server VMs
|
||||||
assertVMOption(output, "UseSerialGC", !isServerVM);
|
assertVMOption(output, "UseSerialGC", !isServerVM);
|
||||||
assertVMOption(output, "UseConcMarkSweepGC", false);
|
assertVMOption(output, "UseConcMarkSweepGC", false);
|
||||||
assertVMOption(output, "UseG1GC", false);
|
|
||||||
assertVMOption(output, "UseParNewGC", false);
|
assertVMOption(output, "UseParNewGC", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user