[RSS]

When the NetBeans IDE freezes or becomes sluggish for no apparent reason, it's recommended to generate a thread dump(or profile IDE) and attach as a file to the reported bug. Please use 'Create a new attachment' link in the 'Attachments' section of the IssueZilla header. 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)
    • NB7 and later - there is no nb.exe, just run netbeans.exe from console. If NB is started by shortcut use "--console new" option to open console (netbeans.exe --console new).

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

jstack tool

... is a monitoring tool that is part of JDK installation. The documentation:
  1. jstack from JDK1.5.0
  2. jstack from JDK6.0
  3. 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

StackTrace tool

... allows to get thread dump even without console. It works on all platforms and for all JDKs.
  1. launch from http://www.adaptj.com/root/webstart/stacktrace/app/launch.jnlp
  2. details http://www.adaptj.com/root/main/stacktrace

To generate thread dump:

  1. select main menu item "Process|Thread Dump..."
  2. in dialog click "..." button to open process ID chooser
  3. select PID from the list and confirm the chooser
  4. click OK to request thread dump

VisualVM

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. Available as part of JDK or from download page.

To generate thread dump:

  1. Run VisualVM
  2. Invoke popup menu on the program node
  3. Select Thread Dump

Profile Me Now! - since NetBeans 6.7

(in case you are facing slowness this is prefered way to help NetBeans' developers)

There is a dedicated "Profile Me Now!" button in the toolbar to start, stop self profiling in any distribution that includes NetBeans Profiler.
  1. Make sure the Memory toolbar is displayed. In case the button is not visible go to Tools/Plugins and enable Java Profiler.
  2. Click on the button to let the system start capturing thread dumps from the running IDE.
  3. Work in the IDE, emulate an action which seems to be slow.
  4. Press the button again to turn the self profiling off.
  5. System then generates standard NetBeans Profiler snapshot and shows it.
  6. Attach the dump to issuezilla's bug report.
... for details see FitnessViaPartnership

FitnessViaPartnership/profileme.png