JDK-8325139 : JFR SwapSpace event - add free swap space information on Linux when running in a container environment
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 23
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2024-02-01
  • Updated: 2024-06-04
  • Resolved: 2024-03-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 23
23 b13Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
The JFR SwapSpace event  (added by JDK-8324287) has been added but in a Linux containerized environment we currently just report -1, this should be enhanced.
Comments
[~mbeasken] There appears to be a bug in this code. See JDK-8333522.
04-06-2024

Changeset: 3d106cb0 Author: Matthias Baesken <mbaesken@openjdk.org> Date: 2024-03-05 15:34:27 +0000 URL: https://git.openjdk.org/jdk/commit/3d106cb091de6b6ef2a9bf483fb0f5c98c28263c
05-03-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/17966 Date: 2024-02-22 15:32:27 +0000
22-02-2024

I don't think this is a JFR issue, the way how the current swap space event works, is that it's using Hotspot API to get the swap space. The Hotspot API, specifically OSContainer API needs to get enhanced to report the swap space (current usage). Then it should be fairly easy to determine the free portion of it. So to me this is a hotspot runtime issue, or at least this bug may need a "supporting" enhancement in hotspot runtime first to add the missing code, then use it from the JFR event (this bug).
05-02-2024