My approach is to eliminate the obviously unrelated threads. For you, that's likely to be
Attach Listener
Service Thread
Signal Dispatcher
Finalizer
Reference Handler
VM Thread
VM Periodic Task Thread
These are VM managed threads, ie, you didn't create them explicitly or implicitly.
That leaves Thread-x
and the Main
threads.
Looking at the stack traces, you can infer why things are WAITING
based on your knowledge of the code. For example, it looks like the queue is waiting for a Condition
to be met;
parking to wait for <0xab770958> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
Conditions
are signal
ed to wake so you might think about why a signal
message isn't being sent. Because this condition is contained in the queue implementation, it feels unlikely that the problem isn't that you forgot to call signal
. However, you may have forgotten to call something that would in turn call it? or inadvertently setup a situation where a condition is never met?
So I'd look at the flow of events with a view to ensuring anything that is locked is unlocked or for any conditions that would cause a live lock (bear in mind that the JVM/samauri can detect deadlocks but not live locks).
That's my general thoughts on how to solve it. If you wanted to post the code somewhere, it'd be helpful in actually debugging it / offering more insight how people might go about solving it.
Good luck!