等待锁定未(明显)锁定的对象的Java线程 [英] Java threads waiting to lock object that isn't (visibly) locked

查看:100
本文介绍了等待锁定未(明显)锁定的对象的Java线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,当我请求线程转储时,很容易解释性能不佳的系统的症状.也就是说,通常我可以看到许多线程明显在等待监视器,而该监视器已经被另一个监视器释放了.

Normally when I ask for a thread dump, the symptoms of a poorly performing system are easily explained; i.e. normally I would be able to see that a number of threads are clearly waiting on a monitor which has been acquired but not released by another.

在这种情况下,我有很多线程在等待监视器(0x965ad100),但似乎没有一个线程首先拥有该监视器.可以使用以下签名来标识有问题的线程:

In this case, I have a lot of threads waiting for a monitor (0x965ad100), but none appears to have that monitor in the first place. The threads in question can be identified with this signature:

等待锁定< 0x965ad100>(uk.gov.dti.og.fox.ConAgent)

waiting to lock <0x965ad100> (a uk.gov.dti.og.fox.ConAgent)

我已经尝试了Google搜索,发现的似乎都是讨论锁定的监视器的帖子,与等待未锁定的监视器无关.

I've tried Googling this, and all I seem to find are posts that discuss monitors that are locked, nothing about waiting for a monitor that isn't locked.

完整的线程转储: http://www.basson.at/docs/stackoverflow/thread_dump.txt

我希望这里的人可以解释我所看到的,或者至少指向正确的方向.预先感谢您的任何答复.

I hope someone here can explain what I'm seeing, or at least point me in the right direction. Thanks in advance for any responses.

推荐答案

如果使用的是Eclipse,则可以通过调试"视图使用内置的锁查看器,这可能会有所帮助.您可以使用可通过工具栏中的向下箭头访问的下拉菜单启用它:)

If you're using Eclipse, you can use the built-in lock viewer via the Debug view which might be helpful. You can enable it using the drop down menu accessible via the downward arrow in the toolbar :)

这篇关于等待锁定未(明显)锁定的对象的Java线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆