[concurrency-interest] Contended Locking Behavior
ionutb83 at yahoo.com
Fri May 4 03:53:53 EDT 2018
Sorry for spam, any thoughts on this?
On Monday, April 30, 2018, 4:57:43 PM GMT+3, Ionut Balosin <ionutbalosin at yahoo.com> wrote:
I play with a stress test regarding contented locks in JDK 9.0.4 and I have observed below behavior which I would like to double check with you in order to correct my understanding:
- under a "relatively small - medium" contention (i.e. up to 64 threads accessing same lock) default locking scheme inside HotSpot JVM (-XX:+UseBiasedLocking -XX:-UseHeavyMonitors) seems to behave faster than using heavy monitors
- starting with higher number of threads (i.e. 64 threads in my test) enabling heavy monitors (-XX:-UseBiasedLocking -XX:+UseHeavyMonitors) performs better
To sum up: my findings are that heavy monitors brings performance under really high contention however in cases where there are relatively small number of threads default locking scheme seems more beneficial (whatever high or small means ... probably it might be subject to hardware architecture)
My config: CPU: Intel Core i7 6700HQ / OS: Ubuntu x64 16.10
Can you confirm/infirm this?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest