Unbiased Java CPU profiling with JFR in JDK 25
JDK 25 introduces CPUTimeSample, a new first-class JFR event addressing limitations in the existing ExecutionSample mechanism for CPU profiling. ExecutionSample samples threads as observed by the JVM rather than strictly by CPU time, causing inaccurate results in CPU-saturated and reactive workloads where hotspots are underreported. The new event, developed with SAP, Amazon, and the OpenJDK community, provides accurate CPU-time sampling via cooperative stack walking without relying on unsupported JVM internals like AsyncGetCallTrace or vmstructs walking, stabilizing production profiling across scales and application patterns.
This post is licensed under CC BY 4.0 by the author.