8227123: Assertion failure when setting SymbolTableSize larger than 2^17 (131,072)
authorcoleenp
Tue, 30 Jul 2019 09:56:18 -0400
changeset 57593 f40a73b61b5e
parent 57592 11de092bcc5a
child 57594 61c2e3e7315d
8227123: Assertion failure when setting SymbolTableSize larger than 2^17 (131,072) Summary: Increase max size for SymbolTable and fix experimental option range. Fix option range test to include experimental options. Reviewed-by: jiangli, dholmes, hseigel, gziemski
src/hotspot/share/classfile/symbolTable.cpp
src/hotspot/share/runtime/globals.hpp
test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java
test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java
--- a/src/hotspot/share/classfile/symbolTable.cpp	Tue Jul 30 09:26:47 2019 -0400
+++ b/src/hotspot/share/classfile/symbolTable.cpp	Tue Jul 30 09:56:18 2019 -0400
@@ -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;
 
--- a/src/hotspot/share/runtime/globals.hpp	Tue Jul 30 09:26:47 2019 -0400
+++ b/src/hotspot/share/runtime/globals.hpp	Tue Jul 30 09:56:18 2019 -0400
@@ -2339,11 +2339,11 @@
   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")                                       \
--- a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java	Tue Jul 30 09:26:47 2019 -0400
+++ b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOption.java	Tue Jul 30 09:56:18 2019 -0400
@@ -44,6 +44,9 @@
 
 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 @@
             runJava.add(explicitGC);
         }
 
+        runJava.add(UNLOCK_FLAG1);
+        runJava.add(UNLOCK_FLAG2);
+
         runJava.addAll(prepend);
         runJava.add(optionValue);
         runJava.add(JVMStartup.class.getName());
--- a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java	Tue Jul 30 09:26:47 2019 -0400
+++ b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java	Tue Jul 30 09:56:18 2019 -0400
@@ -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 @@
     /* 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 @@
      * @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 @@
         if (GCType != null) {
             runJava.add(GCType);
         }
+        runJava.add(UNLOCK_FLAG1);
+        runJava.add(UNLOCK_FLAG2);
         runJava.add(PRINT_FLAGS_RANGES);
         runJava.add("-version");