RFR [14]: 8232207: Linux os::available_memory re-reads cgroup configuration on every invocation

Claes Redestad claes.redestad at oracle.com
Tue Oct 15 09:12:58 UTC 2019


on a Linux system with container support, os::available_memory will read
cgroup configuration files from /proc to determine max memory limits.
This leads to measurable memory overheads in some places, e.g., JIT
compiler threads will poll os::available_memory between compilation to
determine if we need to reduce the number of compiler threads.

Overhead from polling these /proc files can take up to 5% of total CPU
resource usage during startup and warmup.

This patch caches the max memory limit and adds a very short (20ms) 
grace time re-reading it from cgroup config files. This is enough to
reduce the overhead to be more or less undetectable on my system, while
not significantly reducing responsiveness to configuration changes.

Bug:    https://bugs.openjdk.java.net/browse/JDK-8232207
Webrev: http://cr.openjdk.java.net/~redestad/8232207/open.00/

Testing: tier1-3 (with a 1s grace time, rerunning a sanity test with



More information about the hotspot-runtime-dev mailing list