Java Performance Tuning
Java(TM) - see bottom of page
Our valued sponsors who help make this site possible
JProfiler: Get rid of your performance problems and memory leaks!
Training online: Concurrency, Threading, GC, Advanced Java and more ...
News August 2020
JProfiler
|
Get rid of your performance problems and memory leaks!
|
JProfiler
|
Get rid of your performance problems and memory leaks!
|
|
|
Back to newsletter 237 contents
This month I'm listing all the new performance features in the upcoming release of Java 15 (I have done this every 6 months prior to each new release, you can track back to the previous February and August newsletters if you want to see what's new performance-wise in any release). As usual I give the new features, the performance benefits from each feature, and how to use the feature.
Java 15 has a bunch of niche performance features I'll sumarize shortly, but there is one general one that is really useful for everyone: finally you can have heap dumps written in compressed (gzip) format! I've added the compress-after-dump step so many times it's automatic, I forgot it's even a feature I'd like for the JVM, so this is a lovely additional feature. Also worth mentioning in the general feature area is that ZGC and Shenandoah are no longer experimental from Java 15 (though people have been using these in production prior to Java 15 anyway, so this just formalizes the reality).
What about the niche features? If you are a 3rd-party library builder, you want to start using Hidden classes (JEP371) to decrease your class lifecycle and improve your footprint; if you do any off-heap work you want to review the Foreign-Memory Access API (JEP383) to make sure it covers your use cases or feedback quickly; if you use UDP you want to test with the new DatagramSocket implementation (JEP373) as there will be subtle changes that could affect you; anyone using biased locking to get that last little performance boost needs to feedback quickly if removing it has serious consquences, as it's going away (JEP374); if you used and need high performance Network Interface Cards (NIC) for your app, SO_INCOMING_NAPI_ID is now supported (JDK-8243099); anyone padding or structuring their classes for cache-line management needs to review the structure as the field layout computation has changed (JDK-8237767).
Now on to the details of those Java 15 changes, including the options you have available to use them.
A note from this newsletter's sponsor
JProfiler
Get rid of your performance problems and memory leaks!
News
Java performance tuning related news - Java 15 generally useful performance features.
Java performance tuning related news - Java 15 niche performance features.
- JEP371 Hidden Classes - can reduce the JVM footprint if frameworks use these instead of other mechanisms, by reducing the lifetime of generated classes. Also these classes can be created faster (as ClassLoader::defineClass is slower than the new mechanism which should have similar performance to Unsafe::defineAnonymousClass). If you generate classes at runtime you should investigate this
- JEP373 Reimplement the Legacy DatagramSocket API. Likely to affect performance in some use cases - but you'll only be able to tell with testing. Note the old version can be used (for a version or two) with the flag -Djdk.net.usePlainDatagramSocketImpl
- JEP374 Disable and Deprecate Biased Locking - the -XX:+UseBiasedLocking option to re-enable it is still available (as are associated flags), but will be removed in a future version. Worth testing whether it's still needed, the assumption is that it no longer makes a significant difference on the latest hardware. The JDK team requests you to report any significant performance regressions with biased locking disabled
- Added Linux specific socket option for SO_INCOMING_NAPI_ID support to jdk.net.ExtendedSocketOptions. The socket option allows applications to query the NAPI (New API) ID of the underlying device queue associated with its socket connection and take advantage of the Application Device Queue (ADQ) feature of high performance Network Interface Card (NIC) devices. The NAPI ID is associated with the queue on which the last frame is received - this let's you split the incoming flows among threads based on the Rx queue on which they are received, improving thread-IO locality
- Field Layout Computation Changed - potential performance impact. The way that field layout is computed has been changed, with more aggressive optimizations to avoid unused gaps in instances. Can be disabled with option -XX:-UseEmptySlotsInSupers. (For a limited time, you can use the old layout with option -XX:-UseNewFieldLayout, but that will be removed in a future release)
- JEP383 Foreign-Memory Access API (Second Incubator) useful for off heap management
Java performance tuning related news - Java 15 even nicher performance features.
The following JEPs released in JDK 15 version have no performance nor memory impact: JEP378 (Text Blocks); JEP372 (Remove the Nashorn JavaScript Engine); JEP381 (Remove the Solaris and SPARC Ports); JEP385 Deprecate RMI Activation for Removal); JEP360 (Sealed Classes preview) and JEP375 (Pattern Matching for instanceof preview)
Jack Shirazi
Back to newsletter 237 contents
Last Updated: 2025-03-25
Copyright © 2000-2025 Fasterj.com. All Rights Reserved.
All trademarks and registered trademarks appearing on JavaPerformanceTuning.com are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries. JavaPerformanceTuning.com is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
URL: http://www.JavaPerformanceTuning.com/news/news237.shtml
RSS Feed: http://www.JavaPerformanceTuning.com/newsletters.rss
Trouble with this page? Please contact us