8237045: JVM uses excessive memory with -XX:+EnableJVMCI -XX:JVMCICounterSize=2147483648

Limit JVMCICounterSize flag's value range to 1M

Reviewed-by: thartmann, redestad
This commit is contained in:
Vladimir Kozlov 2020-03-17 12:42:48 -07:00
parent 176192499f
commit 6083173f9b
3 changed files with 21 additions and 2 deletions

View file

@ -84,7 +84,8 @@ class fileStream;
\ \
NOT_COMPILER2(product(intx, MaxVectorSize, 64, \ NOT_COMPILER2(product(intx, MaxVectorSize, 64, \
"Max vector size in bytes, " \ "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, \ NOT_COMPILER2(product(bool, ReduceInitialCardMarks, true, \
"Defer write barriers of young objects")) \ "Defer write barriers of young objects")) \
@ -93,10 +94,11 @@ class fileStream;
"Trace level for JVMCI: " \ "Trace level for JVMCI: " \
"1 means emit a message for each CompilerToVM call," \ "1 means emit a message for each CompilerToVM call," \
"levels greater than 1 provide progressively greater detail") \ "levels greater than 1 provide progressively greater detail") \
range(0, 6) \
\ \
experimental(intx, JVMCICounterSize, 0, \ experimental(intx, JVMCICounterSize, 0, \
"Reserved size for benchmark counters") \ "Reserved size for benchmark counters") \
range(0, max_jint) \ range(0, 1000000) \
\ \
experimental(bool, JVMCICountersExcludeCompiler, true, \ experimental(bool, JVMCICountersExcludeCompiler, true, \
"Exclude JVMCI compiler threads from benchmark counters") \ "Exclude JVMCI compiler threads from benchmark counters") \
@ -106,6 +108,7 @@ class fileStream;
\ \
experimental(intx, JVMCINMethodSizeLimit, (80*K)*wordSize, \ experimental(intx, JVMCINMethodSizeLimit, (80*K)*wordSize, \
"Maximum size of a compiled method.") \ "Maximum size of a compiled method.") \
range(0, max_jint) \
\ \
experimental(ccstr, JVMCILibPath, NULL, \ experimental(ccstr, JVMCILibPath, NULL, \
"LD path for loading the JVMCI shared library") \ "LD path for loading the JVMCI shared library") \

View file

@ -213,6 +213,12 @@ public class TestOptionsWithRanges {
*/ */
excludeTestMaxRange("CICompilerCount"); 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) * Exclude MallocMaxTestWords as it is expected to exit VM at small values (>=0)
*/ */

View file

@ -185,6 +185,10 @@ public class JVMOptionsUtils {
option.addPrepend("-XX:+UseNUMA"); option.addPrepend("-XX:+UseNUMA");
} }
if (name.contains("JVMCI")) {
option.addPrepend("-XX:+EnableJVMCI");
}
switch (name) { switch (name) {
case "MinHeapFreeRatio": case "MinHeapFreeRatio":
option.addPrepend("-XX:MaxHeapFreeRatio=100"); option.addPrepend("-XX:MaxHeapFreeRatio=100");
@ -223,6 +227,12 @@ public class JVMOptionsUtils {
case "TLABWasteIncrement": case "TLABWasteIncrement":
option.addPrepend("-XX:+UseParallelGC"); option.addPrepend("-XX:+UseParallelGC");
break; break;
case "BootstrapJVMCI":
case "PrintBootstrap":
case "JVMCIThreads":
case "JVMCIHostThreads":
option.addPrepend("-XX:+UseJVMCICompiler");
break;
default: default:
/* Do nothing */ /* Do nothing */
break; break;