missing Monitor Usage functionality

Questions about YourKit Java Profiler
Post Reply
vladimirvv
Posts: 12
Joined: Mon Jun 29, 2009 5:15 am

missing Monitor Usage functionality

Post by vladimirvv »

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.
Vladimir Kondratyev
Posts: 1624
Joined: Tue Aug 10, 2004 7:52 pm

Re: missing Monitor Usage functionality

Post by Vladimir Kondratyev »

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!"
christoph
Posts: 2
Joined: Tue Jan 19, 2016 2:27 pm

Re: missing Monitor Usage functionality

Post by christoph »

Has this feature been implemented in the meantime?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: missing Monitor Usage functionality

Post by Anton Katilin »

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
christoph
Posts: 2
Joined: Tue Jan 19, 2016 2:27 pm

Re: missing Monitor Usage functionality

Post by christoph »

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?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: missing Monitor Usage functionality

Post by Anton Katilin »

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.
Post Reply