Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create the thread dump of the java process and for that i'm using nohup kill -3 command. In that case nohup.out file is created but it's empty. Even i tried redirecting the file to some other locations and even the created file is also empty.

Can anybody please help me out?

Thanks Ram

share|improve this question
Are you running from the terminal or from the crontab? And which shell type are you using: csh, ksh, bash, ...? – quanta Sep 24 '12 at 7:36
thanks for your response quanta. I'm running the script from terminal and the shell type is ksh. Even i tried using the jstack tool comes along with jdk 1.5 and even that didn't help me much – Ramgopal Sep 24 '12 at 7:40

You may be looking in the wrong place. Think of the kill -3 command as not producing a thread dump itself but as telling your java application to do so.

So check its log files, and its working directory (use pwdx command to find that).

share|improve this answer
Hi ramruma, I guess i'm looking at the right place. Just to verify i have used the pwdx as per you advise and it generates the nohup.out file but then it's empty again – Ramgopal Sep 24 '12 at 7:51
Do not use nohup. Is this java application writing to its own log files? If so, look in there. Use pwdx on the java app to find its working directory. – ramruma Sep 24 '12 at 8:04
kill -3 <pid> command doesn't create any logs in the running application and i'm pretty sure that kill -3 is the basic command and which will work to get the thread dumps in all the Java version. It's so strange Ramruma. isn't it? And as i said earlier i redirected the kill -3 <pid> to some other location like 'kill -3 9612 > /opt/webmethods/7.1.2/PPT01a/threaddumps.txt ' and it creates the file named 'threaddumps.txt' in the path given but then it's empty again. – Ramgopal Sep 24 '12 at 9:11
You are redirecting the output of the kill command but the kill command just sends a signal to your java app. You need to find where java is writing. – ramruma Sep 24 '12 at 10:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.