A new version of the JDK is being released every six-months, and with it come improved performance and new runtime features. Upgrading to a runtime might seem daunting, but did you know you can run code built using older versions of Java on the newest runtimes? And that you can still benefit from these performance and runtime improvements?
The JVM is continuously seeing performance improvements with every new JDK release. With upgrading to a newer runtime you can expected to see improvements across:
Memory footprint
Startup
Ramp up
Throughput
All without having to recompile code or make any configuration changes.
A demonstration of these improvements can be seen with the below example of a load test using the Spring Boot Petclinic App:
Application startup: 8.665 seconds
Load test execution time: 137 seconds
Application startup: 6.452 seconds
Load test execution time: 130 seconds
JFR recordings of load tests can be viewed here: link
Security is always a top priority with every JDK release. In the Java Bugs System, you can see here the security vulnerabilities being patches and improvements made from the release of JDK 9 on link.
There are a number of other runtime improvements and features that can also be taken advantage of by moving to the latest JDK runtime including:
jlink
Helpful NullPointerExceptions
Java 8:
Exception in thread "main" java.lang.NullPointerException
at NPEService.main(NPEService.java:7)
Java 16:
Exception in thread "main" java.lang.NullPointerException:
Cannot invoke "String.length()" because "<local1>" is null
at NPEService.main(NPEService.java:7)