Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Java Mission Control 来分析我的应用程序。“线程”选项卡中的有用指标包括每个线程被阻塞的次数。但是,我似乎无法找到一种方法来获取哪些代码线程被阻塞。有没有办法——以编程方式或通过 JMC——找出阻塞发生的位置?
您可以在 Threads/Hot Threads 选项卡上的 Hot Methods 子选项卡中查看不同的堆栈跟踪,单击一个线程以仅查看该堆栈跟踪。
在 JMC 6 中,您会在 Lock Instances 页面中看到相同的信息,并在 Stack Trace 视图中看到堆栈跟踪。