Diagnostic commands can also be invoked by overriding the default behavior of the SIGQUIT process signal. Recollect from Chapter 4 that the default behavior of a JVM receiving a SIGQUIT is to write a thread dump containing the current state of all the threads to the console. One way of sending a SIGQUIT signal to the JVM process is to press Ctrl + Break (Windows), or Ctrl + \ (Linux), in the shell where the Java process was started. On *NIX-systems, executing kill -3 <PID>
or kill -QUIT <PID>
from a shell is an alternative way of issuing a SIGQUIT to a process with a given ID.
To override the SIGQUIT behavior of JRockit with a custom command sequence; put the list of commands to be executed in a plain text file and name it ctrlhandler.act
. The file needs to be placed into the lib
folder of JRockit distribution or the current directory of the JVM process. The presence of a crtlhandler.act
file overrides the behavior of the SIGQUIT signal and makes it execute...