CPU profiling and flame graphs
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
read a flame graph and find the hot spot.
Planned topics
- Sampling profilers capture stacks many times per second.
- Flame graph: width equals share of samples; a wide frame at the top is hot code; the stack below shows who called it.
- Look for wide plateaus, not tall towers.
- Safepoint bias can mislead some profilers; JFR and async-profiler reduce it (verify).
- Flame graph tells where time goes, not whether time is waiting; combine with thread-state data.
Draft outline details
Demonstration
a flame graph where String.format called from PriceFormatter covers 38% of CPU.
Check your understanding
What does frame width represent?
Show answer
The share of samples that included that frame, so the share of time.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.