Skip to content

Commit

Permalink
8237045: JVM uses excessive memory with -XX:+EnableJVMCI -XX:JVMCICou…
Browse files Browse the repository at this point in the history
…nterSize=2147483648

Limit JVMCICounterSize flag's value range to 1M

Reviewed-by: thartmann, redestad
  • Loading branch information
Vladimir Kozlov committed Mar 17, 2020
1 parent 1761924 commit 6083173
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/hotspot/share/jvmci/jvmci_globals.hpp
Expand Up @@ -84,7 +84,8 @@ class fileStream;
\
NOT_COMPILER2(product(intx, MaxVectorSize, 64, \
"Max vector size in bytes, " \
"actual size could be less depending on elements type")) \
"actual size could be less depending on elements type") \
range(0, max_jint)) \
\
NOT_COMPILER2(product(bool, ReduceInitialCardMarks, true, \
"Defer write barriers of young objects")) \
Expand All @@ -93,10 +94,11 @@ class fileStream;
"Trace level for JVMCI: " \
"1 means emit a message for each CompilerToVM call," \
"levels greater than 1 provide progressively greater detail") \
range(0, 6) \
\
experimental(intx, JVMCICounterSize, 0, \
"Reserved size for benchmark counters") \
range(0, max_jint) \
range(0, 1000000) \
\
experimental(bool, JVMCICountersExcludeCompiler, true, \
"Exclude JVMCI compiler threads from benchmark counters") \
Expand All @@ -106,6 +108,7 @@ class fileStream;
\
experimental(intx, JVMCINMethodSizeLimit, (80*K)*wordSize, \
"Maximum size of a compiled method.") \
range(0, max_jint) \
\
experimental(ccstr, JVMCILibPath, NULL, \
"LD path for loading the JVMCI shared library") \
Expand Down
Expand Up @@ -213,6 +213,12 @@ public static void main(String[] args) throws Exception {
*/
excludeTestMaxRange("CICompilerCount");

/*
* Exclude JVMCI threads counts from testing similar to other threads counts.
*/
excludeTestMaxRange("JVMCIThreads");
excludeTestMaxRange("JVMCIHostThreads");

/*
* Exclude MallocMaxTestWords as it is expected to exit VM at small values (>=0)
*/
Expand Down
Expand Up @@ -185,6 +185,10 @@ private static void addNameDependency(JVMOption option) {
option.addPrepend("-XX:+UseNUMA");
}

if (name.contains("JVMCI")) {
option.addPrepend("-XX:+EnableJVMCI");
}

switch (name) {
case "MinHeapFreeRatio":
option.addPrepend("-XX:MaxHeapFreeRatio=100");
Expand Down Expand Up @@ -223,6 +227,12 @@ private static void addNameDependency(JVMOption option) {
case "TLABWasteIncrement":
option.addPrepend("-XX:+UseParallelGC");
break;
case "BootstrapJVMCI":
case "PrintBootstrap":
case "JVMCIThreads":
case "JVMCIHostThreads":
option.addPrepend("-XX:+UseJVMCICompiler");
break;
default:
/* Do nothing */
break;
Expand Down

0 comments on commit 6083173

Please sign in to comment.