Enno Shioji
Enno Shioji

Reputation: 26882

How can one find out more information when a JVM becomes unresponsive to SIGQUIT?

I have a piece of Java code that sometimes causes the JVM to "hang". When this happens, I can't communicate with it through tools like jvisualvm (the tool will say "connection timed out"), and it will also not print a thread dump or terminate when I issue a SIGQUIT (kill -3). The process will terminate if I issue a SIGABRT (kill -6).

Therefore, I can't get a thread dump nor find out what's in its memory. How can one get more information in this situation? If it helps, the OS is OSX and my JVM version is
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509) Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)

Upvotes: 2

Views: 491

Answers (1)

m0skit0
m0skit0

Reputation: 25874

You can't, this is why it's called "hang". JVM process is unresponsive due to internal issues (e.g. infinite loop, deadlock...), so it won't respond. This could be due to a bug in the JVM implementation. You can try to debug the JVM to find out what's happening. HotSpot is GPL so you can get the source code as well.

If you suspect something in your code is causing this hanging (for example, JVM always hangs when you perform a specific operation), you can paste it so we can take a look.

Upvotes: 1

Related Questions