From the oracle page of jstack:
The output from the jstack pid option is the same as that obtained by pressing Ctrl+\ at the application console (standard input) or by sending the process a QUIT signal.
Also remember that Ctrl+\ is equivalent to a SIGQUIT
.
From what is kill -3 (unix.se):
kill -l shows us all signals. Following this hint 3 means SIGQUIT
So basically both of them do exactly the same thing, i.e asking for a coredump. Here are some pointers related to jstack:
Regarding the output difference, its basically the same thing. There is a one to one mapping between the outputs. See my output for the same application to demonstrate the mapping between the statuses of kill -3
and jstack
. The mapping between the statuses are:
kill -3 | Jstack
------------------------------
RUNNABLE | IN_NATIVE
TIMED_WAITING | BLOCKED
WAITING | BLOCKED (PARK)