Is Java 17 Worth the Upgrade? Performance Benchmarks and Free JDK Insights

This article explains Java 17’s new long‑term‑support release, Oracle’s free JDK licensing, and presents OptaPlanner benchmark results comparing JDK 11, 16 and 17 with G1GC and ParallelGC, highlighting performance gains and migration considerations for developers in production.

21CTO
21CTO
21CTO
Is Java 17 Worth the Upgrade? Performance Benchmarks and Free JDK Insights

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, with each LTS version receiving at least eight years of support.

Java versions are typically updated every six months (March and September), but support for non‑LTS releases lasts only about six months.

Java version lifecycle

Although the usage of six‑month releases is growing, most organizations prefer LTS versions for production due to their stability. A 2021 Snyk report shows 61.5% of production users run Java 11, and half of those also run Java 8.

Oracle launches free Java license

Oracle provides a free, leading‑edge JDK with quarterly security updates for commercial and production use.

The new license is the “Oracle Free Terms and Conditions” (NFTC), allowing free use and redistribution as long as no fees are charged.

Developers can download, use, share, and redistribute Oracle JDK without additional clicks.

Oracle will offer these free versions and updates starting with JDK 17 and will continue for at least one year after the next LTS release. Earlier versions are unaffected.

Oracle will keep releasing OpenJDK under the GPL on the same schedule as since Java 9.

In short, “free” does not mean unrestricted; the NFTC forbids paid redistribution of Oracle’s Java software.

Spring Framework 6 and Spring Boot 3

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 17+ (and Jakarta EE 9+).

Should you upgrade? How fast is Java 17?

OptaPlanner performed a benchmark comparing JDK 11, JDK 16, and JDK 17 using G1GC and ParallelGC. The test ran on a stable machine (Intel Xeon Silver 4116 @ 2.1 GHz, 12 cores/24 threads, 128 GiB RAM, RHEL 8).

JVM options used:

-Xmx3840M

-XX:+UseG1GC (low‑latency, default for all three JDKs)

-XX:+UseParallelGC (high‑throughput)

Main class: org.optaplanner.examples.app.GeneralOptaPlannerBenchmarkApp from the OptaPlanner examples module 8.10.0.Final.

Benchmark methodology:

Each JDK/GC combination was run three times sequentially; results shown are the averages.

Each run solved 11 planning problems (e.g., employee rostering, school timetabling, cloud optimization) for five minutes, logging at INFO level.

The workload is CPU‑bound, creates many short‑lived objects, and heavily exercises the garbage collector.

Performance is measured as the number of score calculations per second – higher is better.

JDK version details:

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 (build 11.0.12+7, mixed mode, sharing)
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)

Results (images):

Table 1 – Scores per second with G1GC

Table 2 – Scores per second with ParallelGC

Table 3 – JDK 17 scores for different GC algorithms

Benchmark summary

On average, Java 17 is 8.66% faster than Java 11 and 2.41% faster than Java 16 when using G1GC.

With ParallelGC, Java 17 is 6.54% faster than Java 11 and 0.37% faster than Java 16.

ParallelGC outperforms G1GC by 16.39%.

Additional note: In a previous JDK 15 benchmark, Java 15 was 11.24% faster than Java 11. The smaller gain of Java 17 does not mean it is slower; the earlier test used a different code base (OptaPlanner 7.44 vs 8.10).

Conclusion

Overall, JDK 17 delivers performance improvements that make upgrading worthwhile, at least for the OptaPlanner demo. The fastest garbage collector in these tests remains ParallelGC, not the default G1GC.

As the first LTS release in three years, Java 17 brings many surprises. With the rise of Go, Kotlin, and other JVM languages, can Java maintain its dominant position?

References:

OpenJDK mailing list announcement

OptaPlanner benchmark blog

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 benchmarkJDKFree License
21CTO
Written by

21CTO

21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.

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.