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 Interview Crash Guide
Java Interview Crash Guide
Java Interview Crash Guide
Is Java 17 Really Faster? Benchmarking JDK 11, 16, 17 with OptaPlanner

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.

Java version lifecycle
Java version lifecycle

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.

G1GC scores
G1GC scores
ParallelGC scores
ParallelGC scores
JDK 17 GC comparison
JDK 17 GC comparison

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.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Javagarbage collectionperformance benchmarkg1gcJDK 17OptaPlannerParallelGC
Java Interview Crash Guide
Written by

Java Interview Crash Guide

Dedicated to sharing Java interview Q&A; follow and reply "java" to receive a free premium Java interview guide.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.