JDK 25's new CPU-Time Profiler
summary
JDK 25 adds a CPU-time profiler that samples by CPU consumption rather than wall clock, producing one sample per 10ms of CPU time (bounded by a default 500 events/sec). It records tip PCs in a per-thread bounded queue and reconstructs full stacks later using unbiased safe-point based stack walking, so computational hotspots map to CPU usage with about 2–3% overhead. Feature is Linux-only, experimental, can lose samples when queues overflow, and is off by default.
AI-written summary · about
chapters (16)
- 0:00JDK 25 CPU-Time Profiler intro
- 5:54What is a profiler
- 7:16Wall-clock profiler limits
- 10:07CPU-time profiler fixes sampling
- 12:34Demo CPU-time profiler
- 15:22Four-year journey
- 18:13Async-profiler and OpenJDK
- 21:50Reliable stack-trace API
- 24:19Profiling API nightmares
- 27:08Safe points in profiling
- 28:57Unbiased stack walking
- 31:49API to CPU-time profiler
- 33:15CPU-time profiler details
- 36:22Challenges and fixes
- 38:08Was it worth it?
- 40:25Q&A
related talks
42mOff-CPU Profiling & Latency Diagnostics in Java
33mWriting a Java Profiler in Pure Java
42mWrite your own Java Profiler in 240 lines of pure Java
50mObservability Beyond the Three Pillars — Continuous Profiling With Alibaba Dragonwell
50mJPoint 2023 TechRadar: Performance Tools
51mThe Power of JDK Flight Recorder: Efficient Profiling and Troubleshooting for Java Applications
46mJava Deep Dive - the ins and outs of profiling
40mProfiling Without Pain: Always-On Performance for the JVM
