Profile Image

What is Create dump file on out of memory error: -XX:+HeapDumpOnOutOfMemoryError?

What is Create dump file on out of memory error: -XX:+HeapDumpOnOutOfMemoryError? Have you used this JVM argument before? What are the pros & cons of using this Java argument? Can you share your perspective/experience in using this JVM argument?

  • jvm-argument

  • xx-heapdumponoutofmemoryerror

  • x-heapdumponoutofmemoryerror

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky







For a large-scale enterprise application, it is very common to consume bigger amount of memory on the server. If the server characteristics were chosen incorrectly, or workload increased and there is no enough memory it is common scenario to face an out of memory error, which will result in an application crash. It’s a critical scenario, which might be hard to replicate and fix. In order to help in this situation JVM comes with a bunch of helpful parameters, one of which is HeapDumpOnOutOfMemoryError. What it does is that instructs the JVM to dump heap into physical file in case of OutOfMemoryError.


The heap dump is in HPROF binary format, and so it can be analyzed using any tools that can import this format. For example, the jhat tool can be used to do rudimentary analysis of the dump. By default the heap dump is created in a file called java_pid pid .hprof in the working directory of the VM


Default Value:


By default it is disabled.






Arguments related:


TODO link HeapDumpPath, OnOutOfMemoryError


Related Posts:





If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your insights will help the entire 10+ million java developer community to develop one standard source of documentation for all the JVM arguments.

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • jvm-argument

  • xx-heapdumponoutofmemoryerror

  • x-heapdumponoutofmemoryerror