http://www.crazysquirrel.com/computing/java/basics/java-thread-dump.jspx
Generating a Thread Dump
Windows
The Java application that you want to produce a thread dump for must be running / started in a command console. When you want to produce a thread dump press Ctrl-Break
Note: it's easier to produce a thread dump on Linux as the JVM doesn't need to be started in a console window.
Linux
If the JVM is running in a console then simply press Ctrl-\.
If the JVM is running in the background then send it the QUIT signal:
kill -QUIT process_idThere process_id is the process number of the running Java process. The thread dump will be sent to wherever standard out is redirected too.
You can generally get the process numbers of of all running Java processes with the command:
ps axf | grep java
Generating a Thread Dump
Windows
The Java application that you want to produce a thread dump for must be running / started in a command console. When you want to produce a thread dump press Ctrl-Break
Note: it's easier to produce a thread dump on Linux as the JVM doesn't need to be started in a console window.
Linux
If the JVM is running in a console then simply press Ctrl-\.
If the JVM is running in the background then send it the QUIT signal:
kill -QUIT process_idThere process_id is the process number of the running Java process. The thread dump will be sent to wherever standard out is redirected too.
You can generally get the process numbers of of all running Java processes with the command:
ps axf | grep java
本文介绍如何在Windows和Linux环境下为运行中的Java应用程序生成线程转储的方法。在Windows中,可以通过启动命令控制台并按下Ctrl-Break键来实现;而在Linux环境下,则可以使用kill-QUIT命令或者直接在控制台按下Ctrl-键。

被折叠的 条评论
为什么被折叠?



