如何使用Eclipse调试Java中的死锁 [英] How to Debug a deadlock in Java using Eclipse

查看:200
本文介绍了如何使用Eclipse调试Java中的死锁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以使用什么技术来调试Java程序中的死锁。
我的IDE是Eclipse,我想我已经识别了两个死锁的线程。在调试器中,右键单击任何有问题的线程,并选择suspend挂起线程并显示当前正在执行的代码。尝试进入或跳过线问题似乎没有效果 - 线程状态更改为步进,控件永远不会返回到调试器,除非再次单击挂起。

谢谢

What techniques can one use to debug what appears to be a deadlock in a Java program. My IDE is Eclipse and I think I've identifid the two deadlocked threads. In the debugger, right-clicking any of the threads in question and selecting suspend suspends the thread and displays the code currently being executed. Attempting step-into or step-over the line question appears to have no effect - the thread state changes to "Stepping" with control never returning to the debugger unless suspend is clicked again.
Thanks

推荐答案

如果您使用的是Sun JVM,请附加JConsole并转到线程窗格。有一个检测死锁按钮。

If you are using a Sun JVM then attach with JConsole and go to the Threads pane. There is a "Detect Deadlock" button.

这篇关于如何使用Eclipse调试Java中的死锁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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