Sending a SIGBREAK signal to a Java process to do a thread dump in Windows

In Linux / Unix if you want a Java process to do a thread dump, you can do a kill -3 <pid>.

In Windows, doing the equivalent requires sending a Ctrl+Break to the input console which results in a SIGBREAK being sent to the process. But what if you do not have an input console? A process started with javaw.exe like what Eclipse does has no input console where you can type in the Ctrl+Break.

So, if you have a running java process without an input console, how do you make it do a thread dump?

The answer is simple – use a utility called SendSignal. Very cleverly written stuff. The author’s description of how he wrote that and some other utilities as part of his Windows programming interests is a nice read.

So, download SendSignal and keep it handy as part of your developer arsenal.

SendSignal.exe <pid> will send a ctrl+break to the process. This will cause a Java process to do a stack dump to stdout.

There are other ways too. Those are for another post. šŸ™‚

Tags: ,
This entry was posted on Thursday, May 26th, 2011 at 11:03 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

2 Responses to “Sending a SIGBREAK signal to a Java process to do a thread dump in Windows”

  1. Banner

    Hello!This is noteworthy

  2. draighera

    i have a computer and didnt wont to startup, Bios dont show and I have a black screen