Where to find synchronization contention evidence in Java?

Our Tomcat web application feels slow when used by hundreds of users The server is in the hosting company, and their report does not show any problems with bandwidth or CPU workload, so I suspect that the reason for the slowdown may be the contention of some legacy code encapsulated under synchronous calls, because it is an easier path

I did some manual tests in the development environment, changed the synchronous call with ThreadLocal solution, and it became faster, but I knew my boss would ask me for some evidence that its production speed would also be faster

How can I determine if there is a problem with thread contention in my application?

Solution

I think the thread details view of the visual VM tool attached to the latest Java 6 JDK will provide (or oppose) reliable evidence for your theory It displays a pie chart of each thread, showing its running, sleeping, waiting and waiting time on the display The last one (shown in red) is what you are interested in:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>