Question

I have a Java process. I am using log4j for logging purpose. I have specified in log4j.xml, location and name of log file. logging is working fine. I have problem with kill -3 logs here.

I trying to get process-dump using kill -QUIT <pid>/ killl -3 <pid>. I expected the dump generated by kill -3 to get updated in log file specified in log4j.xml.

But it is not happening that way. I need the dump to observer thread statuses. I do not know any other way to get process dump of a running process.

Was it helpful?

Solution

kill -3 should output to stdout, so it should be wherever your stdout goes. If not you could try playing with -XX:LogFile JVM option.

Alternative way is jstack as suggested by NPE.

Another alternative is to use jvisualvm - it will produce stackdump in its nice GUI and you can copy it from there.

OTHER TIPS

I need the dump to observer thread statuses. I do not know any other way to get process dump of a running process.

You can use jstack for this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top