Integrated: 8376302: os::Machine::used_memory reports container used memory when running containerized
Casper Norrbin
cnorrbin at openjdk.org
Tue Jan 27 12:37:24 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
This pull request has now been integrated.
Changeset: 528bbe79
Author: Casper Norrbin <cnorrbin at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/528bbe7919785c50dda583277f4146b25eb4d2a4
Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
8376302: os::Machine::used_memory reports container used memory when running containerized
Reviewed-by: eosterlund, sgehwolf
-------------
PR: https://git.openjdk.org/jdk/pull/29413
More information about the hotspot-runtime-dev
mailing list