Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Many threads waiting to lock an object, but no thread is holding that lock

I have an application which is currently stuck and I'm trying to understand why. In the kill -3 (thread dump) output, I see many threads waiting to lock an object (specifically - waiting on a synchronized method of Vector), but I don't see any thread holding that lock.

Any idea how can this be debugged?

Thanks

P.S. I know Vector is old and ArrayList is more recommended, but this is a legacy code which I'm trying to debug.

like image 574
Zamir Avatar asked Oct 02 '22 15:10

Zamir


1 Answers

The situation you describe sounds like a classic case of deadlock.

You could (perhaps should) an IDE such as Eclipse or IntelliJ Idea, through which you could debug your application step-by-step and understand exactly where it stops and what to do.

Alternatively, pasting some code would help clarifying the situation as well as describing your environment in terms of JVM version etc.

like image 124
Diferdin Avatar answered Oct 05 '22 13:10

Diferdin