Skip to content
ES EN
Theme: automatic

Guide: Which Java Version to Use According to the Datadog Report

We use data from Datadog's State of Java report to decide which Java version to migrate to and how to check your services' p99 latency.

Software engineering

Datadog has published its report on the state of the Java ecosystem, based on data observed in production rather than survey responses. In this guide, we use it as a practical exercise: how to benchmark your services against these figures and decide whether it is worth making the leap to a more modern version.

InfoQ's coverage summarizes the main findings. A note of caution is in order: the data comes exclusively from Datadog customers, so there is an inevitable selection bias.

Bar chart showing the distribution of Java versions in production services
The version distribution shows that Java 17 and 21 dominate the landscape.

What You Need

Before you begin, gather three things: an inventory of which Java version each service is running, access to each service's latency metrics (ideally the 99th percentile), and a way to run the same service on a different JDK version in a staging environment. You don't need a specific tool; any observability system you already use will do.

  • An inventory of services with their current Java version.
  • p99 latency metrics from recent weeks.
  • A staging environment where you can switch JDKs risk-free.
  • A chosen JDK distribution, either free or with paid support.
  1. Inventory your versions and compare them to the report's distribution.
  2. Note down the current p99 latency of each service as a baseline.
  3. Choose your target version: Java 17 or 21 are the most sensible candidates.
  4. Spin up the service with the new version in staging and re-measure.
  5. Review the garbage collector and any legacy configurations before migrating.
  6. Plan a gradual rollout and re-measure in production.

Where Everyone Else Is

According to the report, the distribution is as follows: Java 8 at 7%, Java 11 at 9%, Java 17 at 31%, Java 21 at 40%, and Java 25 at 9%. In other words, 80% of services are already running Java 17 or later, and there is more Java 25 than Java 8. Furthermore, over 80% of Java services run in containers, and modern versions are patched more promptly.

If your inventory shows Java 8 or 11, you are in the minority. This is no cause for panic, but it is a reason to plan: those versions are now clearly legacy within this sample.

Measuring Latency Before and After

The most striking data point is the average drop in p99: 230 ms on Java 8, 145 ms on Java 11, 83 ms on Java 17, and 64 ms on Java 21. The article points to the garbage collector as a potential cause: the default shifted from the Parallel collector to G1 between Java 8 and 11, and G1 changed significantly from Java 11 to 17. This is a hypothesis, not a guarantee for your application.

To check which collector your service is using and log its activity, a good starting point is this test startup command (adjust the JAR name to match yours):

java -version
java -Xlog:gc*:file=gc.log -jar mi-servicio.jar

Compare the pause logs and the p99 from your metrics platform between your current version and the candidate version under the same load. This will let you know whether the improvement reported holds true in your specific case.

Downward trend of p99 latency when moving from Java 8 to Java 21
Average tail latency drops markedly between Java 8 and Java 21. Image: Unsplash — Lines of colorful JavaScript code displayed on a dark screen
Tip Change only one variable at a time: first the JDK version and, only afterwards, the garbage collector parameters. If you change both at once, you won't know which one to attribute the improvement (or regression) to.

JDK Distribution and Frameworks

In terms of providers, Amazon Corretto and Eclipse Temurin make up two-thirds of the market, while Red Hat and Oracle are the go-to choices when paid support is needed. Microsoft builds and IBM J9 workloads are missing from the data; ahead-of-time compiled workloads using GraalVM Native sit at around 1%.

Among frameworks, Spring exceeds 75% across its variants with and without Boot. It is followed by Quarkus, which is now managed as an independent project within the Commonhaus Foundation; more than half of its services handle over 100,000 requests per day on average. Lastly, the use of large language models has tripled since January 2025 among Datadog customers, another sign that the ecosystem continues to modernize.

To learn more: Chinese edition.

Original source: infoq.com

Article generated with AI.larebelion

Kernel

· CTO · Spain

"Someone else's p99 figure is useful for sparking the debate, but the decision to migrate must be made using your own metrics."

Comments (0)

No comments yet. You can be the first.

Write a comment