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

Bob Vandette bob.vandette at oracle.com
Tue Oct 15 15:10:33 UTC 2019


Thanks for taking a look at this problem.  We’ve had an issue related to your bug
open for a while and have been investigating many different solutions.  None of them
have been ideal.

https://bugs.openjdk.java.net/browse/JDK-8227006 <https://bugs.openjdk.java.net/browse/JDK-8227006>

I wonder if we should broaden your solution for all metrics available in OSContainer_linux.cpp.

The only downside I see is that CPU count could vary more frequently than your 20ms timeout
as processors go online/offline as part of power management.

Bob.


> On Oct 15, 2019, at 2:12 AM, Claes Redestad <claes.redestad at oracle.com> wrote:
> 
> Hi,
> 
> 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
> 20ms)
> 
> Thanks!
> 
> /Claes



More information about the hotspot-runtime-dev mailing list