RFR: 8334489: Add function os::used_memory [v2]
Severin Gehwolf
sgehwolf at openjdk.org
Thu Jun 20 08:07:14 UTC 2024
On Thu, 20 Jun 2024 06:51:55 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> BTW does anyone know whats the deal with os::physical_memory vs os::Linux::physical_memory on Linux? The former is not cgroup-aware, the latter is. Why do we have two variants?
For all intents and purposes `os::physical_memory()` should be used in VM code. `os::Linux::physical_memory()` is used in a) the container code to have an upper bound for memory limits (the v1 interface of cgroups doesn't have a `max` value like v2 has, for example). b) in some JFR events like `jdk.ContainerConfiguration` where host physical is explicitly queried in addition to the container limit. So we need both.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19772#issuecomment-2180064488
More information about the hotspot-runtime-dev
mailing list