How to Capture Thread Dump in JVM
Let’s
see how to capture thread dump of application in java. We can capture it with
or without Console.Method to generate Thread dump with Console:
1. On Windows:
·
Press Ctrl-Break in the
command console you used to start the IDE
· Press Ctrl-\ in the terminal console you used to start the IDE
· Send the QUIT signal to the Java VM running the IDE
kill -QUIT process_id where process_id is the process number of the respective java process
· The thread dump is printed into the terminal
Note: Just assure that the line buffer is long enough so that the whole thread dump fits in.
If the console isn't opened (in case you started
the IDE using the default desktop icon):
- launch the IDE
using a console window -Start Command Prompt
- -go to {netbeans-install-dir}/bin
-type nb.exe
- configure the
desktop shortcut to launch the nb.exe instead of netbeans.exe (default)
- NB7 and higher - just run
netbeans.exe from console. If NB is started by shortcut use
"--console new" option to open console (netbeans.exe --console
new).
·
The thread dump is printed
into the command console.
· Press Ctrl-\ in the terminal console you used to start the IDE
· Send the QUIT signal to the Java VM running the IDE
kill -QUIT process_id where process_id is the process number of the respective java process
· The thread dump is printed into the terminal
Note: Just assure that the line buffer is long enough so that the whole thread dump fits in.
Comments
Post a Comment