8227123: Assertion failure when setting SymbolTableSize larger than 2^17 (131,072)

Increase max size for SymbolTable and fix experimental option range.  Fix option range test to include experimental options.

Reviewed-by: jiangli, dholmes, hseigel, gziemski
This commit is contained in:
Coleen Phillimore 2019-07-30 09:56:18 -04:00
parent 28479937ea
commit 1186d8203b
4 changed files with 17 additions and 8 deletions

View File

@ -45,10 +45,8 @@
// and not set it too short before we decide to resize,
// to match previous startup behavior
const double PREF_AVG_LIST_LEN = 8.0;
// 2^17 (131,072) is max size, which is about 6.5 times as large
// as the previous table size (used to be 20,011),
// which never resized
const size_t END_SIZE = 17;
// 2^24 is max size, like StringTable.
const size_t END_SIZE = 24;
// If a chain gets to 100 something might be wrong
const size_t REHASH_LEN = 100;

View File

@ -2339,11 +2339,11 @@ const size_t minimumSymbolTableSize = 1024;
product(uintx, StringTableSize, defaultStringTableSize, \
"Number of buckets in the interned String table " \
"(will be rounded to nearest higher power of 2)") \
range(minimumStringTableSize, 16777216ul) \
range(minimumStringTableSize, 16777216ul /* 2^24 */) \
\
experimental(uintx, SymbolTableSize, defaultSymbolTableSize, \
"Number of buckets in the JVM internal Symbol table") \
range(minimumSymbolTableSize, 111*defaultSymbolTableSize) \
range(minimumSymbolTableSize, 16777216ul /* 2^24 */) \
\
product(bool, UseStringDeduplication, false, \
"Use string deduplication") \

View File

@ -44,6 +44,9 @@ import static optionsvalidation.JVMOptionsUtils.VMType;
public abstract class JVMOption {
private static final String UNLOCK_FLAG1 = "-XX:+UnlockDiagnosticVMOptions";
private static final String UNLOCK_FLAG2 = "-XX:+UnlockExperimentalVMOptions";
/**
* Executor for JCMD
*/
@ -408,6 +411,9 @@ public abstract class JVMOption {
runJava.add(explicitGC);
}
runJava.add(UNLOCK_FLAG1);
runJava.add(UNLOCK_FLAG2);
runJava.addAll(prepend);
runJava.add(optionValue);
runJava.add(JVMStartup.class.getName());

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -46,6 +46,9 @@ public class JVMOptionsUtils {
/* Java option which print options with ranges */
private static final String PRINT_FLAGS_RANGES = "-XX:+PrintFlagsRanges";
private static final String UNLOCK_FLAG1 = "-XX:+UnlockDiagnosticVMOptions";
private static final String UNLOCK_FLAG2 = "-XX:+UnlockExperimentalVMOptions";
/* StringBuilder to accumulate failed message */
private static final StringBuilder finalFailedMessage = new StringBuilder();
@ -458,7 +461,7 @@ public class JVMOptionsUtils {
* @throws Exception if a new process can not be created or an error
* occurred while reading the data
*/
public static Map<String, JVMOption> getOptionsAsMap(boolean withRanges, Predicate<String> acceptOrigin,
private static Map<String, JVMOption> getOptionsAsMap(boolean withRanges, Predicate<String> acceptOrigin,
String... additionalArgs) throws Exception {
Map<String, JVMOption> result;
Process p;
@ -475,6 +478,8 @@ public class JVMOptionsUtils {
if (GCType != null) {
runJava.add(GCType);
}
runJava.add(UNLOCK_FLAG1);
runJava.add(UNLOCK_FLAG2);
runJava.add(PRINT_FLAGS_RANGES);
runJava.add("-version");