1

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

Ramgopal
  • 21
  • 2
  • 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 07: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 07:40

1 Answers1

0

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).

ramruma
  • 2,740
  • 1
  • 15
  • 8
  • 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 07: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 08:04
  • kill -3 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 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 09:11
  • 1
    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