RFR: 8360651: Create OSContainer API for memory limit

Severin Gehwolf sgehwolf at openjdk.org
Fri Jun 27 15:04:57 UTC 2025


Please review this small addition to add a new `OSContainer::has_memory_limit()` API (Linux only - as with the entire OSContainer API) in preparation for [JDK-8350596](https://bugs.openjdk.org/browse/JDK-8350596) which proposes to increase the default `MaxRAMPercentage` when this new API returns true. The patch is pretty trivial. It's only the testing which amounts to the most lines in this patch.

Testing:
- [ ] GHA (still running)
- [x] Hotspot container tests on x86_64 Linux on cgroup v1 and cgroup v2 (including the new tests).

Thoughts?

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

Commit messages:
 - MemoryLimitTest whitespace fixes.
 - TestContainerMemory whitespace fixes.
 - 8360651: Create OSContainer API for memory limit

Changes: https://git.openjdk.org/jdk/pull/26020/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26020&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8360651
  Stats: 272 lines in 11 files changed: 269 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/26020.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26020/head:pull/26020

PR: https://git.openjdk.org/jdk/pull/26020


More information about the hotspot-dev mailing list