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 2018
JProfiler
|
Get rid of your performance problems and memory leaks!
|
JProfiler
|
Get rid of your performance problems and memory leaks!
|
|
|
Back to newsletter 213 contents
Java 11 is released in a month (on 25th Sep). It seems like only 6
months ago that I listed
all the Java 10 performance features,
and of course that's because it was only 6 months ago - that's the
new release cadence for Java. Regardless of other aspects, the new
cadence and communications is great for manageably understanding the
new features that we're getting. So naturally, just as I did 6 months
ago for Java 10, this month I'm again listing all the new performance
features and how to use them, for Java 11. All of our regular sections,
tools, news, and articles/blogs/talks are focused on Java 11 related
features, starting with the news section listing every significant new
feature in Java 11, the performance benefits from that feature, and how
to use the feature.
Now on to all those sections, but first I'll mention the most important
performance item in Java 11 - one that is not listed: The CMS
GC is still there! Despite the insistence of many a commentator that
CMS would be gone in Java 11, it is still there, which will come as a
huge sigh of relief for many many companies who were not yet seeing
adequate enough performance from G1.
And of course the tips from this month's articles and talks,
are extracted into
this month's tips page.
A note from this newsletter's sponsor
JProfiler
Get rid of your performance problems and memory leaks!
News
Java performance tuning related news - significant new performance features:
- Many many improvements in G1 mean that if you are using G1 and it's not quite meeting your targets, you should try out the Java 11 JVM on your existing application to see if you get an immediate garbage collection improvement
- JEP 331: Low-Overhead Heap Profiling - low-overhead enough (less than 3%, maybe even less than 1%) to be enabled by default, letting you continuously sample Java heap allocations. Accessible via JVMTI. I expect there will be profilers available to use this as soon as it is released. Potentially the single biggest improvement here - low overhead simple object profiling in production
- JEP 318: Epsilon: A No-Op Garbage Collector - using a new flag -XX:+UseEpsilonGC or -XX:+UseNoGC, this new GC allocates but doesn't collect; once the heap is full the JVM will shut down. Useful for testing and specialized applications that never need a GC (using this collector would avoid GC barriers that are added to the application by other collectors even when no collection is triggered, so if you need to eliminate every last bit of overhead as in ultra-low latency applications, it's a valid GC option)
- JEP 328: Flight Recorder - now open sourced and added in Java 11, records events originating from applications, the JVM and the OS targeting less than 1% overhead when enabled and no overhead when not enabled. Turn on with -XX:StartFlightRecording or dynamically using jcmd with options JFR.start, JFR.dump filename=recording.jfr JFR.stop (eg jcmd PID JFR.start). jdk.jfr package let's your application create events, and also process recorded files of events. Expect this to become pretty standard now that it's open sourced, you should learn to use this if you currently don't - see this month's articles and tools sections for details
- JEP 321: HTTP Client (Standard) - Expected to enable better asynchronous handling of HTTP requests with fewer resources required, using the java.net.http package. You're probably using an Apache or other package which already does this anyway, but whatev, better late than never
- JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental) - new collector targeting pauses of under 10 millisecond for any size heap. ZGC is a concurrent, single-generation, region-based, NUMA-aware, compacting collector; Stop-the-world phases are limited to root scanning so pretty quick! Experimental - need to compile a JVM with --with-jvm-features=zgc and then enable with -XX:+UnlockExperimentalVMOptions -XX:+UseZGC. Likely to require much more memory and CPU than other existing openJDK collectors
- JEP 309: Dynamic Class-File Constants - unlikely to be any immediate performance change (not many tools can take advantage of it yet), though longer term it might reduce startup time by having some processing moved to compile-time and lazy loaded. May be useful for specialized applications that want to use Epsilon (the no-op GC) as it might eliminate some object creation. The new java.lang.invoke.ConstantBootstraps class is provided to assist Java implementations using this feature
- CONSTANT Dynamic with Dan Heidinga and Paul Sandoz Jul 30, 2018 - as an example of how this can improve resource usage, anything that you would make static final but may never use, you can instead put in the constant pool and it only gets loaded if you use it
- Rafael Winterhalter provides a more detailed explanation of constant dynamic and adds an example of using it
Java performance tuning related news - minor new performance features:
Java performance tuning related news - the remaining new features in Java 11 have no expected performance benefit but are also not expected to cause any negative performance impact, and are listed here just for completeness of feature listing:
Tools
Java performance tuning related tools.
Articles
Jack Shirazi
Back to newsletter 213 contents
Last Updated: 2024-12-27
Copyright © 2000-2024 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/news213.shtml
RSS Feed: http://www.JavaPerformanceTuning.com/newsletters.rss
Trouble with this page? Please contact us