Unbiased Java CPU profiling with JFR in JDK 25 | Datadog
Jul 22, 2026Jaroslav Bachorík, Scott Gerring

Summary
This post details the collaboration with SAP, Amazon, and the OpenJDK community to introduce the `CPUTimeSample` event in JDK 25. This new event, combined with cooperative stack walking, provides accurate CPU-time sampling for Java applications, addressing the bias and incompleteness issues previously encountered with JFR's `ExecutionSample` and unsupported JVM internals like `AsyncGetCallTrace`. The post explains the mechanics of profilers, the limitations of existing JVM sampling, and the trade-offs involved in achieving accurate CPU profiling.
More from the Java CPU Profiling trail
- How we built an async-aware Python profiler | Datadog
- From hand-tuned Go to self-optimizing code: Building BitsEvolve | Datadog
- How we tracked down a Go 1.24 memory regression across hundreds of pods | Datadog
- .NET Continuous Profiler: Exception and lock contention | Datadog
- .NET Continuous Profiler: CPU and wall time profiling | Datadog