RFR: 8376302: os::Machine::used_memory reports container used memory when running containerized
Severin Gehwolf
sgehwolf at openjdk.org
Mon Jan 26 15:44:23 UTC 2026
On Mon, 26 Jan 2026 12:16:19 GMT, Casper Norrbin <cnorrbin at openjdk.org> wrote:
> Hi everyone,
>
> In #27646, I introduced interfaces to get machine and container values separately when running inside a container. For `os::used_memory`, I initially moved the container check out of the function, and the remainder became `os::Machine::used_memory`. However, this function was still calling the "normal" `os::` functions, which resulted in the container check being performed again. This was incorrect. I have now updated these calls to use the appropriate `os::Machine::` functions, which do not re-check for containerization. The behaviour of `os::used_memory` itself remains unchanged, as it does the container check before delegating to the `Machine` function.
>
> Testing:
> - Oracle tier 1
> - Manual testing to see that the value works correctly
Marked as reviewed by sgehwolf (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/29413#pullrequestreview-3706662221
More information about the hotspot-runtime-dev
mailing list