EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

How to generate a memory heap dump


Jaime Perez

Vice President, Product Owner • MicroStrategy


Description

Generating a heap dump will be useful to understand a possible memory leak. A heap dump consists of the recorded state of the working memory of a computer program at a specific time. A heap dump will contain all objects in memory, their size and object type at the time of generation of the dump. Heap dumps are useful in the context of troubleshooting issues to determine memory leaks and/or troubleshooting java.lang.OutOfMemoryError at the JVM level.
Be aware that generating a heap dump will have a severe performance impact on the system during the time the heap dump is being collected. As a result, make sure to perform the collection during a maintenance window that will not affect end users using the system. 
 

Solution 

Automatic collection
To capture a heap dump automatically in the event of a java.lang.OutOfMemoryError, add the following option to the Java startup parameters:


-XX:+HeapDumpOnOutOfMemoryError

This parameter will generate a heap dump in the event of a java.lang.OutOfMemoryError in the current directory. If you do not want big dump files in the application working directory then the HeapDumpPath option can be used to specify an alternative location, e.g. -XX:HeapDumpPath=/disk2/dumps
 
Manual collection
In a terminal, execute the following:

jmap -dump:file=app.bin <PID>

where <PID> is the process ID of the Java application that you are collecting a heap dump of.
 

Third Party Software Installation WARNING

The third-party product(s) discussed in this technical note is manufactured by vendors independent of Strategy. Strategy makes no warranty, express, implied or otherwise, regarding this product, including its performance or reliability.
 


Comment

0 comments

Details

Knowledge Article

Published:

March 30, 2017

Last Updated:

September 3, 2019