RFR: 8292083: Detected container memory limit may exceed physical machine memory [v6]
Jonathan Dowland
jdowland at openjdk.org
Fri Aug 19 15:17:57 UTC 2022
On Thu, 18 Aug 2022 22:03:27 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> Jonathan Dowland has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Simplify testContainerMemExceedsPhysical, avoid OperatingSystemMXBean
>>
>> Rewrite the test to run two containers. First time, capture the logging
>> to get the reported physical memory size. Derive a bad value from this
>> (*10). Second run, set the container memory limit to the bad value.
>> Check the trace log for a line indicating this was detected and ignored.
>> - debug log physical memory (not cgroup constrained)
>
> src/hotspot/os/linux/os_linux.cpp line 237:
>
>> 235: log_debug(os, container)("container memory limit unlimited: " JLONG_FORMAT ", using host value "
>> 236: JLONG_FORMAT, mem_limit, phys_mem);
>> 237: }
>
> Can we consolidate these to:
>
>
> const char* reason;
> if (mem_limit >= phys_mem) {
> reason = "ignored";
> } else ...
> }
>
> log_debug(os, container)("container memory limit %s: " JLONG_FORMAT ", using host value "
> JLONG_FORMAT, reason, mem_limit, phys_mem);
Certainly, thanks for the suggestion. Resolved in 7e64194b6b1ee04edfe5b51725e12f121094badc.
-------------
PR: https://git.openjdk.org/jdk/pull/9880
More information about the hotspot-runtime-dev
mailing list