[jdk25u-dev] RFR: 8357570: [macOS] os::Bsd::available_memory() might return too low values

Aleksey Shipilev shade at openjdk.org
Fri Nov 28 11:03:23 UTC 2025


This bugfix improves MacOS reporting, *and* makes further backports in container code cleaner. Notably, it is on the way to [JDK-8370572](https://bugs.openjdk.org/browse/JDK-8370572) backport. The full stack looks like this:


    Clean JDK-8370966: Create regression test for the hierarchical memory limit fix in JDK-8370572
(!) Clean JDK-8370572: Cgroups hierarchical memory limit is not honored after JDK-8322420
    Clean JDK-8292984: Refactor internal container-related interfaces for clarity
    Clean JDK-8356868: Not all cgroup parameters are made available
    Clean JDK-8367485: os::physical_memory is broken in 32-bit JVMs when running on 64-bit OSes
    Clean JDK-8357086: os::xxx functions returning memory size should return size_t
>>> Clean JDK-8357570: [macOS] os::Bsd::available_memory() might return too low values
    Clean JDK-8364248: Separate commit and reservation limit detection


I looked where this code is used, and I think only management and reporting code realistically depends on it.

Additional testing:
 - [ ] GHA
 - [x] MacOS AArch64 server fastdebug, `jdk_management`

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

Commit messages:
 - Backport 7d7fc69355e6f5421cf09f93290270bb16d13182

Changes: https://git.openjdk.org/jdk25u-dev/pull/31/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk25u-dev&pr=31&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8357570
  Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk25u-dev/pull/31.diff
  Fetch: git fetch https://git.openjdk.org/jdk25u-dev.git pull/31/head:pull/31

PR: https://git.openjdk.org/jdk25u-dev/pull/31


More information about the jdk-updates-dev mailing list