8336912: G1: Undefined behavior for G1ConfidencePercent=0

Reviewed-by: ayang, sangheki
This commit is contained in:
Thomas Schatzl 2024-07-31 08:08:15 +00:00
parent e63d01654e
commit de0b50400a
2 changed files with 6 additions and 6 deletions
src/hotspot/share/gc/g1
test/hotspot/jtreg/gc/arguments

@ -112,7 +112,7 @@
\
product(uint, G1ConfidencePercent, 50, \
"Confidence level for MMU/pause predictions") \
range(0, 100) \
range(1, 100) \
\
product(uintx, G1SummarizeRSetStatsPeriod, 0, DIAGNOSTIC, \
"The period (in number of GCs) at which we will generate " \

@ -51,14 +51,14 @@ public class TestG1PercentageOptions {
}
}
private static final String[] defaultValid = new String[] {
"0", "1", "50", "95", "100" };
private static final String[] defaultInvalid = new String[] {
"-10", "110", "bad" };
private static final String[] rangeOneToHundredValid = new String[] {
"1", "50", "95", "100" };
private static final String[] rangeOneToHundredInvalid = new String[] {
"0", "-10", "110", "bad" };
// All of the G1 product arguments that are percentages.
private static final OptionDescription[] percentOptions = new OptionDescription[] {
new OptionDescription("G1ConfidencePercent", defaultValid, defaultInvalid)
new OptionDescription("G1ConfidencePercent", rangeOneToHundredValid, rangeOneToHundredInvalid)
// Other percentage options are not yet validated by argument processing.
};