tags:

views:

15

answers:

1

I am using JMeter for load testing and some of my threads just hang. I want to do a thread dump but none of the following work from my linux machine

First get JMeter process id using

jps -l

Then did

sudo -u <username> jstack <pid>

and get the following msg

15141: Unable to open socket file: target process not responding or HotSpot VM not loaded The -F option can be used when the target process is not responding

even

kill -3 15141

comes up with nothing

+1  A: 

After lot of googling and trial and error found the solution

To take thread dumps, start JMeter using command line. Open terminal (A)

$ cd /media/9260C06E60C05A9D/Downloads/jakarta-jmeter-2.4/bin
$ ./jmeter > temp

In another terminal (B) Get the process id of JMeter

$ jps -l
$ kill -QUIT 21735

Now check temp file for thread dump.

In order to use jstack make sure the user and group user are the same as the user running jstack