A flame graph visualizes collected stack traces hierarchically. The horizontal axis represents collected stacks, call frequency, or resource consumption—not time—while the vertical axis represents stack depth. Each rectangle represents a function call or operating-system syscall; its width indicates invocation count or running time. The top rectangle is the function running when the stack was collected. Colors mainly distinguish frames and carry no inherent semantics. section 9.1.2
Use flame graphs to inspect profiling signals and locate expensive execution paths:
- Compare horizontal widths to find functions consuming substantial CPU time or appearing frequently in samples. section 9.1.2
- Follow vertical parent-child relationships to understand which callers lead to an expensive function. section 9.1.2
- Apply the visualization beyond CPU profiling, including memory and network I/O analysis. section 9.1.2
- Treat production use cautiously because continuous profiling can impose resource impact and may disrupt workloads. section 9.1.5
Reading a pprof profile
A Go pprof example shows slowTask() occupying much more CPU than quickTask(). The graph also shows slowTask() called from main(), allowing the reader to connect resource consumption with its calling path. A protobuf-encoded pprof profile supplies the collected profiling data that the visualization renders. section 9.1.2 section 9.4
Inspect the pprof flame-graph figure to connect rectangle width, stack depth, and the slowTask() call path. section 9.1.2

