Skip to content

Conversation

graalvmbot
Copy link
Collaborator

This PR adds support for heap dumps to the Community Edition (CE) of GraalVM Native Image. These dumps use the hprof format and can thus be opened with VisualVM like any other Java heap dump.

To enable heap dump support, native executables need to be built with the -H:+AllowVMInspection build-time option. Afterward, it is possible to create heap dumps in currently three different ways:

  • The initial heap of a native executable can be dumped using the -XX:+DumpHeapAndExit run-time option (e.g., ./helloworld -XX:+DumpHeapAndExit).
  • Heap dumps can also be requested at run-time by sending the SIGUSR1 signal to the running process (kill -SIGUSR1 <pid>).
  • Heap dumps can also be created programmatically using the VMRuntime.dumpHeap(String outputFile, boolean live) API.

thurka and others added 2 commits June 5, 2022 11:50
This PR adds support for heap dumps to the Community Edition (CE) of GraalVM Native Image. These dumps use the hprof format and can thus be opened with [VisualVM](https://visualvm.github.io/) like any other Java heap dump.

To enable heap dump support, native executables need to be built with the `-H:+AllowVMInspection` build-time option. Afterward, it is possible to create heap dumps in currently three different ways:

- The initial heap of a native executable can be dumped using the `-XX:+DumpHeapAndExit` run-time option (e.g., `./helloworld -XX:+DumpHeapAndExit`).
- Heap dumps can also be requested at run-time by sending the `SIGUSR1` signal to the running process (`kill -SIGUSR1 <pid>`).
- Heap dumps can also be created programmatically using the [`VMRuntime.dumpHeap(String outputFile, boolean live)` API](https://github.com/oracle/graal/blob/6b59dd9b007c1fcc5bf9a16d80fe831209b652c2/sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/VMRuntime.java#L77-L89).

Co-authored-by: Christian Haeubl <[email protected]>
Co-authored-by: Peter Hofer <[email protected]>
@fniephaus fniephaus self-assigned this Jun 6, 2022
@fniephaus fniephaus added this to the 22.2 milestone Jun 6, 2022
@olpaw olpaw self-requested a review June 7, 2022 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants