Profile Image
vishnupriya

What is Set file location for memory dump: -XX:HeapDumpPath?

What is Set file location for memory dump: -XX:HeapDumpPath? 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-heapdumppath

  • x-heapdumppath

  • Set file location for memory dump

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:

 

-XX:HeapDumpPath=file-path

 

Description:

 

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 HeapDumpPath, which is used in conjunction with HeapDumpOnOutOfMemoryError. What it does is that instructs the JVM to dump heap into physical file with specified location 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.

 

Errors:

 

None

 

Arguments related:

 

TODO link HeapDumpOnOutOfMemoryError, OnOutOfMemoryError

 

Related Posts:

 

 

NOTE:

 

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-heapdumppath

  • x-heapdumppath

  • Set file location for memory dump