Skip to content

[GR-75880] Support Native Image JFR emergency dumps on Windows#13607

Open
graalvmbot wants to merge 3 commits into
masterfrom
GR-75880
Open

[GR-75880] Support Native Image JFR emergency dumps on Windows#13607
graalvmbot wants to merge 3 commits into
masterfrom
GR-75880

Conversation

@graalvmbot
Copy link
Copy Markdown
Collaborator

Adds Native Image support for JFR emergency dumps on Windows.

Native Image already supports writing regular JFR recordings on Windows, but out-of-memory emergency dumps were still unavailable because the emergency-dump implementation was tied to POSIX directory and file handling. This PR makes emergency dumping an OS-independent feature with small platform-specific adapters.

Implementation overview:

  • Introduces AbstractJfrEmergencyDumpSupport for the common emergency-dump flow: dump path handling, repository fallback, emergency chunk creation, chunk filename validation/sorting, dump file assembly, and lifecycle test hooks.
  • Refactors PosixJfrEmergencyDumpSupport to use the shared base while keeping POSIX-specific repository scanning, openat-based file opening, and path-buffer handling local to the POSIX implementation.
  • Adds WindowsJfrEmergencyDumpSupport, using Win32 APIs for repository enumeration, file opening, file attributes, system time, path conversion, and cleanup.
  • Extends the Windows native header bindings needed by the implementation.
  • Updates JFR emergency dump tests so the same behavioral coverage can run on both POSIX and Windows, including repository fallback, support lifecycle, emergency dump contents, metadata-only dumps, constant-pool data, and non-ASCII path handling.
  • Enables the JFR image demo on Windows and updates the Native Image JFR documentation to list Windows emergency dumps as supported.

Reviewer notes:

  • The shared base intentionally contains the JFR/HotSpot-derived emergency-dump algorithm; the platform classes are responsible only for OS-specific path, directory, and file operations.
  • Emergency repository chunks now use timestamp-style names with retry suffixes instead of a single fixed emergency_chunk.jfr, so repeated fallback chunk creation does not depend on replacing the same file.
  • The companion graal-enterprise PR updates the JDK checksum metadata required by the new Windows support.

thomaswue added 3 commits May 23, 2026 17:54
Rebase the GR-75880 changes onto master after the dependent Windows JFR and heap dump support landed.
@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label May 24, 2026
@thomaswue thomaswue requested a review from roberttoyonaga May 24, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants