Profilers are lying hobbitses
summary
Most Java profilers mislead because they sample only at safepoints so hotspots get blamed on the wrong lines and loops and safe point bias makes JVisualVM results unreliable. Better tools sample with signals but need the flag -XX:+DebugNonSafepoints enabled. Java Flight Recorder hides failed samples and native work, Honest‑Profiler reports failures, while Async-Profiler recovers samples and shows user/kernel stacks. Inlining and instruction skid confuse line‑level blame so use flame graphs plus per‑thread counts and expected sample math.
AI-written summary · about
chapters (17)
- 0:00Introduction to profilers
- 2:31Why developers avoid profilers
- 6:09Safe point bias in profilers
- 11:32Better profilers than JVisualVM
- 15:06Java Flight Recorder limitations
- 19:22Debug flags for accurate profiling
- 20:27Flame graphs explained
- 24:03CPU instructions and profiling
- 33:36Instruction profiler accuracy
- 37:55Mapping instructions to code
- 40:21Method-level profiling issues
- 43:35Inlining and profiling confusion
- 45:44Method granularity problems
- 46:47Compilation versions over time
- 48:34Thread utilization in profiles
- 51:46Why profilers lie to us
- 52:06Q&A session
