How to generate Java Heap Dump?

Posted on 2009-07-07
Last Modified: 2013-12-11
I want to generate Java Heap Dump to detect Memory Leak. Although I am able to generate Javacore files I could not generate heapdump files. I am using IBM Websphere 6.1 on Windows.

I did following settings:
Navigated to: Servers > Application Servers > Server1 (or the name of
      the server to get a heap dump) > Process Definition > Environment Entries

Then set following properties:

Then I am running following commands in command prompt:
wsadmin> set jvm [$AdminControl completeObjectName type=JVM,*]
wsadmin> $AdminControl invoke $jvm dumpThreads

Am I missing something?
Question by:cuttieveenz
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
LVL 20

Expert Comment

ID: 24801654
This link shoud help you configure what you want ... I hope IBM presents you the page in engish though ... as the german is sometimes rather bad, I would think it automatically translates.
LVL 41

Expert Comment

ID: 24803208
The simple answer is that it depends upon your operating system (OS).

For example


Aix & Linux:

LVL 41

Expert Comment

ID: 24803878
It looks like you tried the instructions from

After this command:

wsadmin> set jvm [$AdminControl completeObjectName type=JVM,*]

use this one to show the current value of the "jvm" variable:

wsadmin> puts $jvm

What does it show?

Personally, I prefer to use Jython (which is available in a more robust form in v 6.1 and v7.0).
The Jython statements for these commands would be:

1. add "-lang jython" to the command line options used to start wsadmin
    e.g., "wsadmin -lang jython"

2. jvm = AdminControl.completeObjectName( 'type=JVM,*' );
    wsadmin> jvm = AdminControl.completeObjectName( 'type=JVM,*' );

3. print the value of the jvm variable (note the lack of '$' for jython variables):
    wsadmin> print jvm

4. call (invoke) the dumpThreads routine

  Then, look for the javacore file.  I found mine under <WAS_HOME>\profiles\<profileName>, specifically:

> dir D:\IBM\WebSphere\AppServer70\profiles\AppSrv00\javacore*.txt

 Directory of D:\IBM\WebSphere\AppServer70\profiles\AppSrv00

07/08/2009  10:00 AM         2,193,629 javacore.20090708.100003.872.0001.txt

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.


Accepted Solution

cuttieveenz earned 0 total points
ID: 24811322
We figured out why we couldn't generate Heap dumps. Instead of running the following command:
$AdminControl invoke $jvm dumpThreads
The following should be run:
$AdminControl invoke $jvm generateHeapDump
LVL 41

Expert Comment

ID: 24812760
Right, the dumpThreads would be used to create a javacore
LVL 41

Expert Comment

ID: 24831041
Sorry I misunderstood the request.

Anything else?

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error in @AspectJ Based AOP with Spring 2 24
Java: anonymous class 4 39
What is the use of Forwarding Class in java 1 37
Java List 4 45
Configure Web Service (server application) I. Configure security for Web Services methods First, we need to protect Session bean which implements the service: 1. Open EJB deployment descriptor (ejb-jar.xml) in the EJB project that contains you…
Most of the developers using Tomcat find it easy to configure the datasource in Server.xml and use the JNDI name in the code to get the connection.  So the default connection pool using DBCP (or any other framework) is made available and the life go…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question