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

Matthias Baesken mbaesken at openjdk.org
Thu Feb 29 08:54:55 UTC 2024


On Wed, 28 Feb 2024 15:06:14 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   limit_from_str might return negative values
>
> src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp line 188:
> 
>> 186:         char* mem_swp_current_str = mem_swp_current_val();
>> 187:         jlong swap_current = limit_from_str(mem_swp_current_str);
>> 188:         return memory_usage + swap_current;
> 
> `limit_from_str()` might return negative values in case of `OS_CONTAINER_ERROR` (`-2`) or `max` => `-1`. Please account for that. For example:
> 
> return memory_usage + (swap_current >= 0 ? swap_current : 0);

Makes sense. I adjusted the coding - btw should we add some UL logging in the case of failures/negative values ?

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

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


More information about the hotspot-runtime-dev mailing list