How can I profile threads in Java?

一世执手 提交于 2019-12-21 17:52:59

问题


I have producer and consumer threads in my application and I need to profile them to see the performance of the threads, time taken before each goes to sleep and waits, etc., and take corrective action to improve the over all efficiency of the application.

Any suggestions on how to go about this?


回答1:


Personally I use YourKit java profiler. It has an excellent thread profiler tool that graphically shows the state of each thread at any given time, relative to one another (among other things). Worth a look

http://www.yourkit.com/overview/index.jsp




回答2:


There are a number of tools, both free and non-free.
Check out javaperformancetuning.com for both tools and tricks.
From personal experience I can say that VisualVM from snoracle is a good tool and NetBeans has a good profiler.



来源:https://stackoverflow.com/questions/5086959/how-can-i-profile-threads-in-java

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