views:

74

answers:

1

Hello guys, I'm looking to find a way how to identify a non responding (not zombie) process programatically. I find some information to check TH_STATE_UNINTERRUPTIBLE status but there was some discussion that it's not the right way. Any ideas?

+1  A: 

I'm assuming you mean a spinning wheel application hang? There are many ways to freeze. The particular cause is important. If it's a Cocoa app, you could try sending your main thread / Window an event... or scripting up Spin Control.

Pestilence
Hello,thanks for your reply. Unfortunately the process I'm trying to monitor is not my application but a commercial java application. It sometimes takes the whole CPU and stops accepting connections. My idea was to monitor it and when it stops responding restart it.
BobC
In that case, can you schedule a background process to open a connection and "ping" the server? Probably also launching the Java app with a ulimit so it won't saturate the CPU when it does tank.
Pestilence