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

Thomas Stuefe stuefe at openjdk.org
Wed Sep 10 16:15:37 UTC 2025


On Mon, 8 Sep 2025 17:54:10 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>> 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:
>> - [x] GHA
>> - [x] Hotspot container tests on x86_64 Linux on cgroup v1 and cgroup v2 (including the new tests).
>> 
>> Thoughts?
>
> Severin Gehwolf has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
> 
>  - Merge branch 'master' into jdk-8360651-mem-limit-api
>  - MemoryLimitTest whitespace fixes.
>  - TestContainerMemory whitespace fixes.
>  - 8360651: Create OSContainer API for memory limit

Looks good to me. Is the copyright still correct?

test/hotspot/jtreg/containers/docker/TestContainerMemory.java line 62:

> 60:         try {
> 61:             testWithMemoryLimit();
> 62:             testWithoutMemoryLimit();

Just a remark, if you do these as separate tests (separate `@test` blocks), you can parallelize their execution and start them separately via jtreg command line if needed.

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

Marked as reviewed by stuefe (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/26020#pullrequestreview-3206870866
PR Review Comment: https://git.openjdk.org/jdk/pull/26020#discussion_r2337253290


More information about the hotspot-dev mailing list