Coffee Talk: Java, News, Stories and Opinions

Aug 24 2016   1:41AM GMT

Performance improvements of contended Java monitor from JDK 6 to 9

ThomasKrieger Profile: ThomasKrieger

Tags:
Uncategorized

The new JDK™ 9 early access release contains a JDK enhancement proposal JEP 143, Improve Contended Locking, to improve the performance of contended monitors.

Monitors are used by the java synchronized statement to lock the access to a code block. If the synchronized block is called by many threads, the monitor becomes contended. This can degrade the performance dramatically.

Therefore we benchmarked a synchronized method with jmh for different JDK versions. Our Benchmark showed that for 16 Threads JDK 8 needs 2580 ns while JDK 9 only needs 1655 ns for our method. This is an improvement by more than 60 percent. In JDK 9 contended monitors are almost as performant as contended reentrant locks.

Read the full article here.

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: