Linux – Does kill -3 actually terminate a java process? Or just generate a thread dump

centosjavalinuxpid

CentOS 5.9

If I run kill -3 <java process pid> what actually happens? As per this red hat article, I understand that a Java Thread Dump is generated but is the process terminated? It doesn't appear to be based on my tests:

[root@foobox ~]# kill -3 14559

[root@foobox ~]# service foo status
foo (pid 14559) is running...

In other words: could I collect a thread dump via this manner without impacting the service?

Best Answer

Hopefully, kill -3 doesn't terminate the JVM process.

A thread dump is very slightly impacting the service during the stacktrace collection, especially if thousands of threads are running.

Note that if the -Xrs flag is used, the JVM no more specifically handle the SIGQUIT signal and then that signal will likely terminate the process unless a alternate handler is in place in some native code.