Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-38994] Add support for -XX:+HeapDumpOnOutOfMemoryError #4641

Closed
galderz opened this issue Jun 13, 2022 · 8 comments · Fixed by #7012
Closed

[GR-38994] Add support for -XX:+HeapDumpOnOutOfMemoryError #4641

galderz opened this issue Jun 13, 2022 · 8 comments · Fixed by #7012

Comments

@galderz
Copy link
Contributor

galderz commented Jun 13, 2022

Feature request

Following on the addition of heap dumps, support for -XX:+HeapDumpOnOutOfMemoryError should be added. This flag enables the heap dump to be dumped in the event of an out of memory error.

Describe who do you think will benefit the most.
-XX:+HeapDumpOnOutOfMemoryError is a flag that is commonly used in Java programs. Now that heap dumps can be retrieved on demand, Java developers would expect this flag to be available. Heap dumps are needed the most when the JVM is running out of memory.

Describe alternatives you've considered.
The alternative would be for a user to somehow be alerted when an OOME is reported and for the user to request a heap dump manually or via some automation.

I'd like to contribute this feature.

@fniephaus
Copy link
Member

I assume this is about GraalVM Native Image, not the JVM mode, right?

@fniephaus fniephaus changed the title Add support for -XX:+HeapDumpOnOutOfMemoryError [GR-38994] Add support for -XX:+HeapDumpOnOutOfMemoryError Jun 13, 2022
@fniephaus fniephaus added this to To do in Native Image via automation Jun 13, 2022
@thomaswue
Copy link
Member

This is a great suggestion. One prerequisite for making this work is to modify the heap dumping code to avoid allocations - or at least stay within some predefined allocation bounds reserved for this feature.

@fniephaus
Copy link
Member

I believe @thomaswue is referring to #4637.

@galderz
Copy link
Contributor Author

galderz commented Jun 14, 2022

Indeed for this to work the heap dump generation has to be virtually allocation free, otherwise you might get an OOME again when trying to dump it. I'll give this a go once #4637 has been resolved.

@jerboaa
Copy link
Collaborator

jerboaa commented Jun 30, 2022

Apparently @christianhaeubl is working on heap dump refactoring. So this needs a bit of coordination @galderz

@TharmiganK
Copy link

@christianhaeubl any update on supporting this feature?

@christianhaeubl
Copy link
Member

@galderz any update regarding your plans on supporting this feature?

@galderz
Copy link
Contributor Author

galderz commented Jul 14, 2023

@christianhaeubl I'll have a look now that allocation-free heap dump is in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment