Is Java 17 Really Faster? Benchmarking JDK 11, 16, 17 with OptaPlanner
The article explains Java 17’s release as the first LTS since Java 11, details Oracle’s new free JDK license, and presents a thorough OptaPlanner benchmark that compares JDK 11, 16, and 17 using G1GC and ParallelGC, revealing performance gains and guiding upgrade decisions.
Java 17 Release and Oracle’s Free JDK License
Java 17 has been officially released as the first long‑term‑support (LTS) version since Java 11. Oracle plans to shorten the LTS release cycle to every two years and guarantee at least eight years of support for each LTS release. Regular six‑month releases continue in March and September with limited support.
Oracle announced a free JDK license (NFTC) that allows anyone to download, use, share, and redistribute Oracle JDK for commercial and production purposes without charge. The key points are:
Free, leading‑edge Oracle JDK with quarterly security updates.
The NFTC license permits free use, even in production, as long as the software is not sold.
Developers can download and redistribute the JDK without additional steps.
The free versions start with JDK 17 and will continue for subsequent LTS releases.
Oracle will keep providing OpenJDK builds under the GPL as before.
Spring Framework Update
Before Java 17’s release, the Spring team announced that Spring Framework 6 and Spring Boot 3 aim for general availability in Q4 2022, supporting Java 8‑17 on the Spring 5.3.x line and Jakarta EE 9+ on the Java EE 7‑8 line.
Benchmark Overview
OptaPlanner performed a benchmark comparing JDK 11, JDK 16, and JDK 17. The hardware used was an Intel® Xeon® Silver 4116 (2.1 GHz, 12 cores/24 threads) with 128 GiB RAM running RHEL 8. The JVM options were -Xmx3840M and either -XX:+UseG1GC (default) or -XX:+UseParallelGC. The main class was org.optaplanner.examples.app.GeneralOptaPlannerBenchmarkApp.
openjdk 11.0.12 2021-07-20
OpenJDK Runtime Environment Temurin-11.0.12+7 (build 11.0.12+7)
OpenJDK 64-Bit Server VM Temurin-11.0.12+7 (build 11.0.12+7, mixed mode) openjdk 16.0.2 2021-07-20
OpenJDK Runtime Environment (build 16.0.2+7-67)
OpenJDK 64-Bit Server VM (build 16.0.2+7-67, mixed mode, sharing) openjdk 17 2021-09-14
OpenJDK Runtime Environment (build 17+35-2724)
OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)Benchmark Results
Results were averaged over three runs for each JDK/GC combination. The key findings are:
With G1GC, Java 17 is 8.66 % faster than Java 11 and 2.41 % faster than Java 16.
With ParallelGC, Java 17 is 6.54 % faster than Java 11 and 0.37 % faster than Java 16.
ParallelGC outperforms G1GC by 16.39 % on Java 17.
Note: Machine reassignment numbers showed high variance (over 10 %) between runs, but the averaged scores remained stable.
Conclusion
Overall, JDK 17 delivers noticeable performance improvements for OptaPlanner workloads, making the upgrade worthwhile. ParallelGC consistently provides the best throughput, outperforming the default G1GC.
Despite the rise of other JVM languages like Go and Kotlin, Java 17’s LTS status and performance gains keep it competitive in the modern development landscape.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Interview Crash Guide
Dedicated to sharing Java interview Q&A; follow and reply "java" to receive a free premium Java interview guide.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
