On Thu, 8 May 2025 08:37:25 GMT, Severin Gehwolf <[email protected]> wrote:
>> Severin Gehwolf has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 44 commits: >> >> - Merge branch 'master' into jdk-8336881-metrics-systemd-slice >> - JDK-8350103 >> - Merge branch 'master' into jdk-8336881-metrics-systemd-slice >> - Merge branch 'master' into jdk-8336881-metrics-systemd-slice >> - Fix missing imports >> - Merge branch 'master' into jdk-8336881-metrics-systemd-slice >> - Merge branch 'master' into jdk-8336881-metrics-systemd-slice >> - Merge branch 'master' into jdk-8336881-metrics-systemd-slice >> - Merge branch 'master' into jdk-8336881-metrics-systemd-slice >> - Merge branch 'master' into jdk-8336881-metrics-systemd-slice >> - ... and 34 more: https://git.openjdk.org/jdk/compare/6801eb87...32960cd6 > > Keep open, bot. @jerboaa We hit the case this PR targets, inside a container rather than a systemd slice. Do you plan to `/open` it again? Setup: a Kubernetes pod under Sysbox (`sysbox-runc`), cgroup v2, limited to 1536Mi and 2 CPUs. Sysbox runs the container's processes in `/init.scope` and keeps the limits on the container's cgroup, the root of the cgroup namespace. On Temurin 21.0.13: getTotalPhysicalMemorySize 32857440256 (node memory, not the 1.5G limit) availableProcessors 8 (node CPUs; JDK-8392375 fixes this in 28) Runtime.maxMemory 389283840 (HotSpot finds the 1.5G limit via JDK-8322420) So HotSpot and `Metrics` disagree inside the same JVM. Code that sizes caches from `OperatingSystemMXBean` (RocksDB memtables, in our case) sizes them from the host. One concern about the current design: it skips the walk on containerized systems, on the assumption that the limits sit at the leaf. Under Sysbox the leaf has no limits, so the skip would miss this case. Walking up to the namespace root whenever the leaf reads `max` would cover it. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20280#issuecomment-7175907994
