How to Generate a Thread Dump
When the NetBeans IDE freezes or becomes sluggish for no apparent reason, it's a recommended to generate a thread dump and attach file to the reported bug.
Do not copy the thread dump into the description field.
The Thread Dump
... is a textual dump of all active threads and monitors of Java apps running in a Virtual Machine.
To generate thread dump:
- Windows
- Press Ctrl-Break in the command console you used to start the IDE
If the console isn't opened (in case you started the IDE using the default desktop icon):
- launch the IDE using a console window
(invoke Command Prompt, go to {netbeans-install-dir}/bin and type nb.exe)
- configure the desktop shortcut to launch the nb.exe instead of netbeans.exe (default)
- Unix, Linux, Mac OS X
- 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
process_id is the process number of the respective java process
... is a monitoring tool that is part of JDK installation. The documentation:
- jstack from JDK1.5.0
- jstack from JDK6.0
- On Mac OS X, jstack sometimes fails with an error message. As a workaround, you can generate a thread dump using killall -9 hsdbd; sudo jstack pid
... allows to get thread dump even without console. It works on all platforms and for all JDKs.
- launch from http://www.adaptj.com/root/webstart/stacktrace/app/launch.jnlp
- details http://www.adaptj.com/root/main/stacktrace
To generate thread dump:
- select main menu item "Process|Thread Dump..."
- in dialog click "..." button to open process ID chooser
- select PID from the list and confirm the chooser
- click OK to request thread dump
The
VisualVM is a tool that provides a visual interface for troubleshooting, profiling and viewing detailed information about Java applications while they are running on a Java Virtual Machine. Avalaible as part of JDK or from
download page.
To generate thread dump:
- Run VisualVM
- Invoke popup menu on the program node
- Select Thread Dump