---
title: "Unbiased Java CPU profiling with JFR in JDK 25"
description: "JDK 25 adds an experimental JFR CPU-time sampling event (CPUTimeSample) that gives unbiased CPU profiles without relying on the unsupported HotSpot AsyncGetCallTrace API."
url: "https://swe.quest/articles/unbiased-java-cpu-profiling-with-jfr-in-jdk-25-9bdec8ca98b4801c"
canonical: "https://www.datadoghq.com/blog/engineering/jfr-cpu-time-profiling/"
source: "Datadog Engineering"
published: "2026-07-22"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 10
tags: ["jvm","performance","observability","runtimes"]
---

# Unbiased Java CPU profiling with JFR in JDK 25

A post on [Datadog Engineering](https://swe.quest/sources/datadog.md), published 2026-07-22, 10 min read, Deep dive. Original: [https://www.datadoghq.com/blog/engineering/jfr-cpu-time-profiling/](https://www.datadoghq.com/blog/engineering/jfr-cpu-time-profiling/)

## Summary

JDK 25 adds an experimental JFR CPU-time sampling event (CPUTimeSample) that gives unbiased CPU profiles without relying on the unsupported HotSpot AsyncGetCallTrace API. The existing ExecutionSample event samples a rotating subset of threads rather than in proportion to CPU time, which can underreport hotspots, notably in reactive workloads. Profilers such as Datadog's therefore combined JFR with SIGPROF-driven AsyncGetCallTrace and vmstructs walking, trading stability for accuracy. After the AsyncGetStackTrace JEP stalled, Oracle, SAP, Amazon and Datadog engineers built on cooperative stack walking, which records lightweight execution points and unwinds only at safepoints. Native frame support and safe on-demand stack capture are next.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Java & JVM](https://swe.quest/tags/jvm.md) (Languages)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [Runtimes & VMs](https://swe.quest/tags/runtimes.md) (Compilers & runtimes)

## Prerequisites

- JVM basics ([easy posts on Java & JVM](https://swe.quest/tags/jvm.md?difficulty=easy))
- sampling profilers
- safepoints

## Keywords

JFR, JDK 25, AsyncGetCallTrace, JVMTI, async-profiler, CPUTimeSample, OpenJDK, cooperative stack walking

## Related posts

- [.NET Continuous Profiler: CPU and wall time profiling](https://swe.quest/articles/net-continuous-profiler-cpu-and-wall-time-profiling-5dcdacf43942cb04.md): Datadog Engineering · 2024-02-13 · Hard · 10 min read · .NET, Performance engineering, Runtimes & VMs, Observability, Linux
  Datadog's .NET continuous profiler samples managed threads every 10 ms instead of relying on ETW, perf or enter/leave hooks, which cost too much for 24/7 production use.
- [Android profiling now uses Perfetto via ProfilingManager](https://swe.quest/articles/android-profiling-now-uses-perfetto-via-profilingmanager-538acbb1b0bbfbfb.md): Sentry · 2026-11-02 · Medium · 3 min read · Mobile, Performance engineering, Observability
  Sentry Android SDK 8.51.0 switches profiling on Android 15+ (API 35+) from in-process Debug.startMethodTracing to Perfetto-based stack sampling via the system ProfilingManager API, while older devices fall back to the legacy profiler.
- [How we wrote a Python profiler](https://swe.quest/articles/how-we-wrote-a-python-profiler-397d52e3f1db71ec.md): Datadog Engineering · 2020-10-07 · Medium · 7 min read · Python, Performance engineering, Observability
  Datadog built an always-on statistical profiler for Python because deterministic profilers like cProfile can add 2-3x overhead, too much for production.
- [Strobelight: A profiling service built on open source technology](https://swe.quest/articles/strobelight-a-profiling-service-built-on-open-source-technology-6a094fead0e4b62a.md): Meta Engineering · 2025-01-21 · Medium · 12 min read · Performance engineering, Observability, Linux, Cost optimization, Compilers
  Strobelight is Meta's fleet-wide profiling orchestrator, running 42 profilers (mostly eBPF-based, plus ad-hoc bpftrace scripts) on every production host with safeguards against PMU counter conflicts, concurrency limits and queuing.
- [Boosting the performance of virtual machines with Jump-Start](https://swe.quest/articles/boosting-the-performance-of-virtual-machines-with-jump-start-e63dbfae46ebd497.md): Meta Engineering · 2021-03-03 · Easy · 3 min read · Compilers, Runtimes & VMs, Performance engineering, Deployment, PHP
  Jump-Start cuts JIT warm-up overhead in HHVM by having a small slice of the fleet collect profiling data during Facebook's phased rollout.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
