2010-12-14

Generating Dump []

Moved to the page http://3rdstage.wikia.com/wiki/J2EE_Application_Tuning in my wiki as of 5th Oct. 2012.

Generating Heap Dump

For IBM Java SDK, you can trigger dumps including.... For more refer : http://publib.boulder.ibm.com/infocenter/hctool/v1r0/topic/com.ibm.java.diagnostics.healthcenter.doc/topics/triggering.html

Generating Thread Dump

Sun JDK

The following is quoted from J2SE 5.0 Troubleshooting and Diagnostic Guide.

1.16 Ctrl-Break Handler

On Solaris or Linux the HotSpot VM will print a thread dump to the application's standard output if the Ctrl and \ keys are pressed. The thread dump consists of the thread stack for all Java threads in the VM. On Windows the equivalent key sequence is the Ctrl and Break keys. The thread dump doesn't terminate the application – it continues after the thread information is printed.
On Solaris and Linux a thread dump is also printed if the J2SE process receives a QUIT signal. So kill -QUIT <pid> causes the process with id <pid> to print a thread dump to its standard output.
In addition to the thread stacks, the ctrl-break handler also executes a deadlock detection algorithm. If any deadlocks are detected then it prints out additional information on each deadlocked thread.
IBM Java SDK

The following is quoted from IBM Java SDK Diagnostics Guide 6.

Chapter 25. Using Javadump

...

The signal for Linux, AIX and z/OS is SIGQUIT. Use the command kill -QUIT n to send the signal to a process with process id (PID) n. Alternatively, press CTRL+\ in the shell window that started Java.(CTRL+V on z/OS.)
The signal for AIX is SIGQUIT. Use the command kill -QUIT n to send the signal to a process with process id (PID) n. Alternatively, press CTRL+\ in the shell window that started Java.
In Windows, the dump is initiated by using CTRL+Break in the command window that started Java.
The signal for i5/OS is SIGQUIT. Use the command kill -QUIT n to send the signal to a process with process id (PID) n. The PID for a particular JVM can be found in the joblog for the job (JVAB56D: Java Virtual Machine is IBM Technology for Java. PID(x)), or using the "ps" command from qsh or an i5/OS PASE shell.
The JVM will continue operation after the signal has been handled.

Obtaining Clue on OOM(OutOfMemory) Error

OutOfMemoryError is one of the most terrible problems. To prevent it from occurring again, it is very important to identify the cause. The heap dump at the time of error maybe provide the most exact cause to the error. With JDK 1.5 or higher, you can use the following options with JVM to obtain the heap dump at the time when OutOfMemoryError ocurrs.


-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=path-of-dump-to-generate

One thing that needs to be considered more is that the above options derive how much overhead or side effects. I don't have any idea about it, and so I have no confidence where the above options can be safely used in production environment. To confirm using in production environment, more thorough research is necessary.

0 comments:

Post a Comment