[12] RFR(S): 8177899: Tests fail due to code cache exhaustion on machines with many cores

Tobias Hartmann tobias.hartmann at oracle.com
Mon Oct 22 10:19:52 UTC 2018


please review the following patch:

On machines with many cores/CPUs, we hit the "Not enough space in non-nmethod code heap to run VM"
check when running with -XX:+SegmentedCodeCache and a small code heap size because we assume that
all space in the non-nmethod code heap will be occupied by temporary code buffers. This is too
conservative for two reasons:
1) With -XX:+UseDynamicNumberOfCompilerThreads (default since JDK-8198756), we create compiler
threads on demand and might not even get close to creating as many threads as initially assumed.
2) The required space also depends on dynamic properties like the number of i2c/c2i adapters and we
will gracefully handle the OOM case by throwing an error anyway.

I've removed the check and verified that all affected tests pass. Of course, one can still trigger a
"no space to run compilers" warning or a "VirtualMachineError: Out of space in CodeCache for method
handle intrinsic" by running with something like -XX:CICompilerCount=50 -XX:ReservedCodeCacheSize=3M
-XX:-UseDynamicNumberOfCompilerThreads but that's a user error (or test bug).


More information about the hotspot-compiler-dev mailing list