Java 6 JVM Hang

偶尔善良 提交于 2019-11-30 15:38:21

The provided thread trace is complete with respect to the lock in question. Two other people I work with agree that a JVM fault is clearly indicated, as do the programmers at jProfiler (ej-technologies).

Are you sure thread RelayedMessages-0000000001 gets notified? It is normal for the other threads to be blocked as the first thread still obtains the lock for <0x12a8f9f8>. In order to other threads can obtain the lock, first thread should be removed from wait list and scheduled to run again and afterwards release the lock that it obtained.

May be there are other threads waiting the same object that the first thread waits for and when you say notify those threads are chosen to wake up. If it is possible make sure to use notifyAll().

Also may be you can release the lock before putting the thread in wait list or call wait by giving a timeout value. it doesn't make sense that the thread is in wait list for 16 hours. If you can also post the other threads that would be also helpful.

Update:

You're right, I should've taken into consideration the Thread.State. As you commented, it is not in wait state since it has been notified. Being in wait list is not the reason of not releasing the lock <0x12a8f9f8>, then. However, it is in Blocked state. That means, it's trying to obtain the lock it had acquired prior to object.wait, but it cannot. So, it seems there is another thread (not in the list that you've provided) blocking it.

I think, you're thinking object.wait should have released the the lock <0x12a8f9f8>. But object.wait only release the lock on that object monitor and keeps the other locks. And I think, lock <0x12a8f9f8> is not the lock for the monitor of the object (for which wait is called)

This might not also be the case of course, and there can be a really bug. I am just trying to come up with possible reasons.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!