RFR: 8367319: Add os interfaces to get machine and container values separately [v5]
Severin Gehwolf
sgehwolf at openjdk.org
Thu Dec 4 10:05:03 UTC 2025
On Thu, 4 Dec 2025 09:28:52 GMT, Casper Norrbin <cnorrbin at openjdk.org> wrote:
> There is a distinction between `OSContainer::memory_limit_in_bytes` (which always fetches and returns the cgroup, including `value_unlimited` for no limit) and the higher-level `os::Container::memory_limit`, which is about determining whether there is an effective limit at all, and if so, what it is. It doesn't make sense to return `true` if there is no limit, since there wouldn't be a meaningful value to provide. `value_unlimited` is just an internal constant and not helpful for callers.
OK. This should be noted in a comment for `os::Container::xxx` functions.
> That said, I can update so we don't pass through the out-parameter so that we don't modify it when returning `false`, to be somewhat more consistent.
I'd prefer that, yes.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27646#discussion_r2588352903
More information about the hotspot-dev
mailing list