RFR: 8292083: Detected container memory limit may exceed physical machine memory [v3]
Jonathan Dowland
jdowland at openjdk.org
Wed Aug 17 13:54:11 UTC 2022
On Wed, 17 Aug 2022 13:36:17 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Jonathan Dowland has updated the pull request incrementally with one additional commit since the last revision:
>>
>> restructure conditions for legibility
>>
>> * split assignment to mem_limit from reading it
>> * nest if expressions to avoid comparing mem_limit twice
>
> src/hotspot/os/linux/osContainer_linux.cpp line 65:
>
>> 63: }
>> 64: if ((mem_limit = cgroup_subsystem->memory_limit_in_bytes()) > 0 &&
>> 65: mem_limit < host_memory) {
>
> I really would like it if these two conditions were nested, that would be easier to understand.
>
> if (memlimit valid and > 0) {
> if (memlimit <= phys) {
> phys = memlimit
> } else {
> log
> }
> }
Thank you; Addressed in `7f5307d69bb` (although possibly moot, once we resolve your other review comment https://github.com/openjdk/jdk/pull/9880#discussion_r947908655).
Presently, we trace log if the memory limit matches physical RAM. We could stop doing that: it doesn't seem too valuable. WDYT?
-------------
PR: https://git.openjdk.org/jdk/pull/9880
More information about the hotspot-runtime-dev
mailing list