jstack-Java Stack Trace

In this article we are going to elaborate the jstack command tool which is a part of JAVA commands (comes with jdk package). This article is the continuation of this previous article.

As we know the standard format of commands in java, the jstack command also have the format(in command prompt)

jstack [ option ] pId
jstack [ option ] exe core
jstack [ option ] [server-id@]remote-hostname-or-IP


In here ,
pId = Java process id (use jps to get the info)
exe = Java executable from which the core dump was produced.
core = core file for which the stack trace is to be printed.
remote-hostname-or-IP = Debug server's (see jsadebugd) hostname or IP address.
server-id= (optional) unique server id

jstack prints Java stack traces of Java threads for a Java process /core file /a remote debug server.

jstack Options : 
-F : Force a stack dump when 'jstack [-l] pid' is not responsive.
-l : Long listing. (Prints more info about locks)
-m : Prints mixed mode (both Java and C/C++ frames) stack trace.

Note :
-If the given process is running on a 64-bit VM, we need to specify the -J-d64 option.
-In windows, the system path variable should contain jvm.dll(for my pc, it is in C:\Program Files\Java\jre6\bin\server).

Thanks...:) 

No comments:

Post a Comment