RFR: JDK-8324287: Record total and free swap space in JFR [v2]

Lutz Schmidt lucy at openjdk.org
Mon Jan 29 09:30:40 UTC 2024


On Fri, 26 Jan 2024 14:43:50 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> Total and free swap space should be recorded in JFR, because it is important to know e.g. in case of memory shortages.
>> 
>> Currently we only have a container related event (ContainerMemoryUsage) that provides some info but no general event.
>> PhysicalMemory could be enhanced or a new event added.
>> 
>> There is already some coding (see Java_com_sun_management_internal_OperatingSystemImpl_getTotalSwapSpaceSize0 and
>> Java_com_sun_management_internal_OperatingSystemImpl_getFreeSwapSpaceSize0) for the swap space info retrieval.
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   remove comment

Please use globally defined constants. Looks good otherwise.

src/hotspot/os/aix/os_aix.cpp line 281:

> 279:     return -1;
> 280:   }
> 281:   return (jlong)(memory_info.pgsp_total * 4L * 1024L);

please use 4 * K instead of 4L * 1024L. K is declared as size_t in globalDefinitions.hpp.

src/hotspot/os/aix/os_aix.cpp line 289:

> 287:     return -1;
> 288:   }
> 289:   return (jlong)(memory_info.pgsp_free * 4L * 1024L);

Same as above.

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

Changes requested by lucy (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/17581#pullrequestreview-1848181220
PR Review Comment: https://git.openjdk.org/jdk/pull/17581#discussion_r1469292777
PR Review Comment: https://git.openjdk.org/jdk/pull/17581#discussion_r1469291730


More information about the hotspot-dev mailing list