RFR: 8360651: Create OSContainer API for memory limit [v2]

Severin Gehwolf sgehwolf at openjdk.org
Thu Sep 18 09:16:42 UTC 2025


On Thu, 18 Sep 2025 06:35:54 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

> Is it correct to only look at `memory_limit_in_bytes()`? We also have `memory_and_swap_limit_in_bytes()` and `memory_soft_limit_in_bytes()`.

Only `memory_limit_in_bytes()` is being used for the `os::physical_memory()` calculation when in a container. So yes. We should only bump MaxRAMPercentage when that's changed.

`memory_and_swap_limit_in_bytes` is strictly `>= memory_limit_in_bytes`. `memory_soft_limit_in_bytes` is informative only. Showing up in `hs_error` files and `VM.info` output.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/26020#issuecomment-3306409598


More information about the hotspot-dev mailing list