GridPulse

as stimulating as black coffee and just as hard to sleep after.

How to get java thread stack traces for a Windows service with jstack

2 comments

When running in a console window, pressing CTRL+Break signals the JVM to print out all stack traces of currently running threads.

If your application runs as a service (or linux/unix dæmon) you can’t press CTRL+Break, so you have to signal the JVM yourself to produce the stack trace. You can do that on linux by signaling a QUIT to the process, or by using jstack and the PID.
Good news, Java SE 6 on Windows comes with jstack. Yupee! ;) .

So next time you need a thread dump from a java application running as a service just get the pid, fire up a cmd and run jstack <pid>.

Written by Bogdan

December 6th, 2007 at 1:39 pm

Posted in Development,Java

2 Responses to 'How to get java thread stack traces for a Windows service with jstack'

Subscribe to comments with RSS or TrackBack to 'How to get java thread stack traces for a Windows service with jstack'.

  1. Hello. It is test.

    BymnRepeZenny

    19 Nov 08 at 11:17 pm

  2. Hello,
    My computer worked not correctly, too much errors. Please, help me to fix buggs on my computer.
    My operation system is Windows XP.
    Thx,
    uttetlycliela

    uttetlycliela

    18 Dec 09 at 8:11 am

Leave a Reply