Generate a java thread dump

Use Kill -3 PID, wherePID is the root of the process tree.

To obtain the root PID, perform a:

#ps -efHl | grep 'java' **. **

ps -efHl | grep 'java'

using a grep argument that is a string that will be found in the process stack that matches the server startup command. The first PID reported will be the root process, assuming that the ps command has not been piped to another routine.

The dump output should be saved to stderr for the process.

Note: Under Linux, each execute thread appears as a separate process under the Linux process stack. To use Kill -3 on Linux you supply must match PID of the main WebLogic execute thread, otherwise no thread dump will be produced

Execute the thread dump a few times over an interval to analyze trends.

http://www.me.umn.edu/~shivane/blogs/cafefeed/2004/06/of-thread-dumps-and-stack-traces.html

* How to do a thread dump on JBoss:

http://wiki.jboss.org/wiki/Wiki.jsp?page=GenerateAThreadDumpWithTheJMXConsole

* Look at garbage collection graphs (growing? high gc collection time?)

* Samurai: http://yusuke.homeip.net/samurai/?english

(Samurai is a tool to show thread dumps in graph form, highlighting the problem threads)

* To turn on verbose gc logging (if not available in console):

-verbose:gc or verbosegc

(Turn this on to help figure out memory leak or general memory problems. A lot of folks will just leave this on all the time - it's not a big overhead).

* JVM Tuning BEA 6 page: http://edocs.bea.com/wls/docs61/perform/JVMTuning.html

3 comments:

HowToDoInJava.com said...

Refer here also for thread dump sampling:
http://howtodoinjava.com/2012/12/19/how-to-get-thread-dump-in-linux-using-jstack/

cafefeedz said...

Best WhatsApp status
www.cafefeedz.com/WhatsApp-status

cafefeedz said...

Best WhatsApp status
www.cafefeedz.com/WhatsApp-status