Fully featured low overhead profiler for Java EE and Java SE platforms.
Ultimate profiling and monitoring solution for Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

missing Monitor Usage functionality

Moderators: Vladimir Kondratyev, Anton Katilin

missing Monitor Usage functionality

Postby vladimirvv » Tue Sep 24, 2013 1:04 pm

Hello,

Monitor usage is very helpful to solve contention problems of
Code: Select all
synchronized(lock) {
  ...
}


Sometimes approach is to introduce
Code: Select all
final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
final ReentrantReadWriteLock.WriteLock writeLock = lock.writeLock();
final ReentrantReadWriteLock.ReadLock  readLock = lock.readLock();


and use writeLock and readLock lock/unlock functionality in appropriate places as "try { ... } finally { ... }" instead of synchronized section.

It would be great to have information about contention on readLock/writeLock of the same ReentrantReadWriteLock as well.
Probably it is available in Flight Recorder of JMC in java7u40.

Thanks!
Vladimir.
vladimirvv
 
Posts: 12
Joined: Mon Jun 29, 2009 5:15 am
Location: St. Petersburg, Russia

Re: missing Monitor Usage functionality

Postby Vladimir Kondratyev » Thu Sep 26, 2013 12:02 pm

Current version of our monitor profiler doesn't support java.util.concurrent API, but this feature is planned for future versions.

Best regards,
Vladimir Kondratyev
YourKit, LLC
http://www.yourkit.com
"Don't get lost in data, get information!"
Vladimir Kondratyev
 
Posts: 1444
Joined: Tue Aug 10, 2004 7:52 pm
Location: Düsseldorf, Germany

Re: missing Monitor Usage functionality

Postby christoph » Tue Jan 19, 2016 2:29 pm

Has this feature been implemented in the meantime?
christoph
 
Posts: 2
Joined: Tue Jan 19, 2016 2:27 pm

Re: missing Monitor Usage functionality

Postby Anton Katilin » Tue Jan 19, 2016 3:43 pm

Not yet, but you can use CPU profiling, either sampling or tracing, to find waiting code. Ensure that wall time is measured.
https://www.yourkit.com/docs/java/help/times.jsp
Anton Katilin
 
Posts: 5576
Joined: Wed Aug 11, 2004 8:37 am

Re: missing Monitor Usage functionality

Postby christoph » Wed Jan 20, 2016 9:57 am

I bought a license to debug such concurrency bottlenecks and a feature promised more than 2 years ago still doesn't exist.

When there is such a bottleneck and one does what vladimirvv suggests it completely dissapears from the lock contention view.
The workaround with the waiting code is not that useful since there are two locks involved and one can not see the interdependency.
When will this be fixed?
christoph
 
Posts: 2
Joined: Tue Jan 19, 2016 2:27 pm

Re: missing Monitor Usage functionality

Postby Anton Katilin » Wed Jan 20, 2016 12:39 pm

The monitor profiling feature depends on events issued by the JVM for Java level monitors. They are not issued for other synchronization primitives.

We cannot (and never did) promise any dates when any additional functionality will be implemented.

You don't need to rely solely on the monitor profiling view, it's just one of many tools the profiler offers. If this particular feature does not suit your case, use CPU profiling.

CPU profiling perfectly and easily allows detection of bottlenecks of any nature, including those caused by using Java concurrent API.
Anton Katilin
 
Posts: 5576
Joined: Wed Aug 11, 2004 8:37 am


Return to Java Profiler

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 5 guests