Thursday, October 23, 2014

JVM thread dumps by using kill

Today I learned something new, courtesy of an interview question from a prominent tech company. If you ever wanted to know how to get stack traces for all threads and summary information of a running JVM under Linux, you can do it with nothing but the familiar kill command. By sending the QUIT signal to the JVM process, it will print information like the following to the console: