Search This Blog

Wednesday, December 16, 2009

What is Javacore and heap dump with diff in WebSphere?

Heap dumps anytime you wish to see what is being held in memory Out-of-memory errorsHeap dumps - picture of in memory objects - used for memory analysisJava cores - also known as thread dumps or java dumps, used for viewing the thread activity inside the JVM at a given time. IBM javacores should a lotof additional information besides just the threads and stacks -- used to determine hangs, deadlocks, and reasons for performance degredationSystem cores
Heap dumps are taken by issuing a "kill -3" against the JVM pid. There is a cost associated with producing heap dumps. The writtingof the heap dump can be cpu and i/o intensive depending on the size of the configured heap, you can take heap dumps anytime you wish to see what is being held in memory. Out-of-memory errors or a good time to view heap dumps. In fact,in most cases heap dumps should be created when an OOM is triggered. Unless you're an administrator or root - you'll need to own the process you want to kill in order for the command to work.Depends on the OS.
Java cores also known as thread dumps or java dumps, used for viewing the thread activity inside the JVM at a given time. javacores should a lotof additional information besides just the threads and stacks used to determine hangs, deadlocks, and reasons for performance degredation.The kill -3 command captures JVM signals and dumps the requested diagnostic material.There are options available to dump the heap in .txt format this files can be huge and unless you're a genius with lots of time on your hands - don't try to read the text dump with vi or something.. Use MDD4J or HeapAnalyzer.
For taking heap dumps you need set these environment entries for that JVM using admin consle(this is one way of doing taking heap dumps, u can also go with jacl or jython scripts)IBM_HEAPDUMP TRUEIBM_HEAPDUMP_OUTOFMEMORY true(if a OOM outofmemory(OOM)occurs, a dump is saved to /tmpIBM_HEAPDUMPDIR appropriate directory.Now, if you run kill -3 pid, then a heap dump is taken in the specified directory and also a core dump will be taken. If you didn't specify any environment entries then only a core dump is taken.

2 comments:

  1. really very useful information but make it in a clear way.it means be clear with what you want to explain. specially grammar.

    ReplyDelete
  2. Hi suresh i have read many blogs for interview questionsbut this blog seems to be very informative and really wanted to take a moment to appreciate the real time issues explained here.greatjob!and thankyou

    ReplyDelete