println

my day-to-day experiences with software

Getting java thread dump under windows

Posted by rajg on September 9, 2008

When your java application stalls/hangs due to a deadlock you want to get a thread dump. Normally you hit ctrl+break under windows (you hit this on the console) and send signal “kill -3″ to the process under nix systems.

Under windows if you are running your java application as a service or is launched from within an IDE (ItelliJ, Eclipse, etc.) you may not have console.  You are struck with the deadlock but it may be hard to reproduce. Fortunately there is way out. Thanks to the StackTrace application. I found this application very useful and I can recommend every java developer to use this in such or many other situations.

StackTrace is free to use if you use it via java web start. Here are the steps to launch it.

1. Hit the “Launch” button on the download page.

2.You will see “Java Starting…” banner. You will also receive a security warning; ignore that.

3.Then hit the “Select process” wheel.

4.You will see “Running JVM processes” dialog. You have to select your stalled process and hit ok.

5.Then go to the “Process” menu and get the thread dump for you process.

You can also launch java tools like jconsole from StackTrace.

Thats it! Happy debugging!

Advertisement

One Response to “Getting java thread dump under windows”

  1. Glumsmurf said

    Hello
    Nice site!

    Bye

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.