Lock analyser for Java application

倖福魔咒の 提交于 2019-12-03 16:49:48

Here's a trick I've used a number of times to find lock contention in production environments from the command line:

watch -n1 'jstack [pid] | grep -A 1 BLOCKED | grep -v BLOCKED | grep -v \\-\\-'

Not only is it free, there's virtually no overhead. It won't give you stats or a nice UI of course, however it makes real-time locking issues obvious in a visual way. Essentially this is sampling every second to find blocked threads. With enough server load you should be able to make a comparison.

YourKit is a good commercial option.

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