本文介绍了jvmti代理死锁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用Java程序运行jvmti代理时,jvm似乎遇到了死锁。
在我的jvmti代理中,我在Agent_OnLoad()中创建一个原始监视器,并在每个回调函数的开头输入该锁,并在每个回调函数的结尾退出该锁。
我不知道这种僵局的原因。

When I run my jvmti agent with a java program, it seems that jvm encounters a deadlock.In my jvmti agent, I create a single raw monitor in Agent_OnLoad() and enter that lock at the beginning of every callback function and exit that lock at the end of every callback functions.I don't know the reason of this deadlock. Is there any other possibilities of deadlocks in jvmti agents?

谢谢。

推荐答案

是的,JVMTI Agent中可能存在死锁。 指出:

Yes, there is a possibility of deadlocks in JVMTI Agent. The JVMTI Reference states:

在这种情况下进行远程诊断可能很困难,但我建议您看看处理原始锁的使用。使用专用功能 enter_critical_section exist_critical_section 。也许有帮助,否则尝试通过调试代理来查找导致死锁的回调。

It can be difficult to make a remote diagnosis in this case, but I would suggest you take a look at how the demo JVMTI applications handle the use of raw locks. The use dedicated functions enter_critical_section and exist_critical_section. Maybe that helps, otherwise try to find the callback which results in a deadlock by debugging the agent.

这篇关于jvmti代理死锁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-12 06:38