Solved

How to generate Java Heap Dump?

Posted on 2009-07-07
7
5,146 Views
Last Modified: 2013-12-11
Hi,
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:
IBM_HEAPDUMP = true
IBM_HEAP_DUMP = true
IBM_JAVA_HEAPDUMP_TEXT=true
IBM_HEAPDUMP_OUTOFMEMORY=false
JAVA_DUMP_OPTS=ONANYSIGNAL(JAVADUMP[5],HEAPDUMP[5])

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?
0
Comment
Question by:cuttieveenz
  • 4
7 Comments
 
LVL 20

Expert Comment

by:ChristoferDutz
Comment Utility
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.

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/tprf_enablingheapdump.html
0
 
LVL 41

Expert Comment

by:HonorGod
Comment Utility
The simple answer is that it depends upon your operating system (OS).

For example

Windows:
  http://www.IBM.com/support/docview.wss?rs=180&uid=swg21384926

Aix & Linux:
  http://www.IBM.com/support/docview.wss?rs=180&uid=swg21297060

Solaris:
  http://www.IBM.com/support/docview.wss?rs=180&uid=swg21321546
0
 
LVL 41

Expert Comment

by:HonorGod
Comment Utility
It looks like you tried the instructions from

http://www.IBM.com/support/docview.wss?rs=180&uid=swg21384926

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
    WebSphere:name=JVM,process=server1,platform=proxy,node=ragweed01Node,j2eeType=JVM,J2EEServer=server1,version=7.0.0.3,type=JVM,mbeanIdentifier=JVM,cell=ragweed01Cell,spec=1.0

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

0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Accepted Solution

by:
cuttieveenz earned 0 total points
Comment Utility
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
0
 
LVL 41

Expert Comment

by:HonorGod
Comment Utility
Right, the dumpThreads would be used to create a javacore
0
 
LVL 41

Expert Comment

by:HonorGod
Comment Utility
Sorry I misunderstood the request.

Anything else?
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now