Currently Being Moderated

How to take thread dumps and report problems when IDEA hangs and doesn't respond

VERSION 2

Created on: Aug 7, 2007 7:35 PM by Serge Baranov - Last Modified:  Nov 25, 2008 9:58 PM by Serge Baranov

The easiest way to take a thread dump is to use the StackTrace tool. Just run it from the Java Web Start and specify the process to take the dump from.  If it doesn't work for you, follow these steps depending on your OS:

Windows

Run IDEA via IDEA_HOME\bin\idea.bat file. You have to set IDEA_JDK environment variable first which points to 1.6 installation home. One of the ways to set it is to add the following line in the beginning of idea.bat file:

SET IDEA_JDK=C:\Program Files\Java\jdk1.6.0_10

Reproduce the problem. When IDEA hangs, press Ctrl+Break (NOT Ctrl+C) in the console window, copy the thread dump from the console.

Linux/Mac OS X/Generic Unix/Solaris

You have to run IDEA with the terminal window shown, start your terminal and run IDEA via IDEA_HOME/idea.sh startup script. Reproduce the problem. Now use the ps utility to find IDEA process (it should be java process started from the idea.sh script), note the process ID (PID). Now open the second terminal window and issue the following command:

kill -QUIT PID

where PID is the the java process ID shown by ps. Thread dump should be printed in the first terminal window.

 

IDEA 8.0 takes thread dumps and saves them automatically on certain conditions under the %idea.system.path%\log directory (in the subdirectories starting with threadDumps).

Tags: dump, dump, hang, thread
Average User Rating
(4 ratings)




Randall Schulz Randall Schulz  says:

What about the "report problems" part of the title? I already knew how to get a thread dump, but came here looking for information on where to send it.

Serge Baranov Serge Baranov  says in response to Randall Schulz:

Use the support section on the jetbrains.com site or write to support@jetbrains.com .

WarnerJan Veldhuis WarnerJan Veldhuis  says:

On Linux, you can hit CTRL-\ instead of CTRL BREAK. (Fedora Core 11, with JDK 1.6.0_14)

Michael Parmeley Michael Parmeley  says:

There is also a executable that comes with Java  called jstack that gives you a thread dump (if "java" or "javac" is in your PATH this one is too):

 

http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jstack.html

Peter Niederwieser Peter Niederwieser  says:

When I run idea.sh from the terminal (Maia IU-90.116, Mac OS 10.6.1), something goes wrong: suddenly I'm asked to set JDK_HOME, and IDEA also thinks that I'm running it for the first time (asks me to import settings, type in license key, etc).

Serge Baranov Serge Baranov  says in response to Peter Niederwieser:

Running IDEA from idea.sh on Mac is possible, but is very tricky as it would require modification of several files including idea.sh, idea.properties and optionally idea.vmoptions. The easier way to run with Terminal window is to click on the IDEA Application folder and choose Show Package Contents from Finder, then navigate to Contents/MacOS folder, right click on idea binary and choose Open With > Terminal.

Stefan Endrullis Stefan Endrullis  says in response to Michael Parmeley:

Thank you very much.  Since killing IDEA with QUIT signal does often not work, jstack is a really good alternativ. It works great!

More Like This

  • Retrieving data ...