RFR: JDK-8325139: JFR SwapSpace event - add free swap space information on Linux when running in a container environment [v7]

Matthias Baesken mbaesken at openjdk.org
Mon Mar 4 14:25:53 UTC 2024


On Mon, 4 Mar 2024 09:35:11 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>> Matthias Baesken has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - remove empty line is os_linux
>>  - adjust os::free_swap_space Linux
>
> src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp line 182:
> 
>> 180:     } else {
>> 181:       // no swap
>> 182:       return 0;
> 
> Is this correct? It appears we ought to return `memory_usage_in_bytes()` in case of no swap.

Adjusted, now I fall through to memory_usage_in_bytes() .

> test/hotspot/jtreg/containers/docker/TestJFREvents.java line 227:
> 
>> 225:             .shouldHaveExitValue(0)
>> 226:             .shouldContain("totalSize = " + expectedTotalValue)
>> 227:             .shouldContain("freeSize = " + expectedFreeValue);
> 
> This may return `freeSize = A` where `0 <= A <= totalSize`. I'd suggest to use a more lenient assertion.

Yeah agree, it is better to adjust the check.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17966#discussion_r1511244765
PR Review Comment: https://git.openjdk.org/jdk/pull/17966#discussion_r1511245255


More information about the hotspot-runtime-dev mailing list