Interact with the flame graph
Cloud Profiler displays profiling data by using flame graphs. For aconceptual introduction, seeFlame graphs.
The flame graph is composed offrames. Each frame represents a functionin the service:
The width of a frame corresponds to its consumption of themetric being analyzed. The top frame, for example, represents the entireservice and consumes 100% of the metric being analyzed. Therefore, thisframe is shown as full width.
By default, the frame color corresponds, where possible,to the function's package. Ifpackage information is unavailable, as with Node.js, the names of the sourcefiles are used to color the function blocks. In a call stack, a change inblock color means a transition from one package to another. You can changethe way the frames are colored. For moreinformation, seeColor mode.
The flame graph shows one or more call stacks with the valuesaveraged over a set of profiles:
- Each individual profile represents data collected one time per minute from asingle instance of the configured service in a single Compute Enginezone. The collection period fora profile varies with the profile type. SeeProfile collection formore information.
- A maximum of 250 profiles are averaged. If there aremore than 250 profiles available,250 of them are selected randomly as a sample set.
- The top frame, or "root", in a flame graph represents the entire service.Under the "root" frame, is another frame or set of frames making up thesecond row in the graph. Each of these color-coded frames is a top-levelcall made by the service.Under each of those colored function frames is another set of functionframes, each of which is responsible for some part of the resource of the frameabove it. The hierarchy of function frames in the graph representsthe call sequence, and the width of a frame represents that function or method'scontribution to the resource consumption.
For example, the profiler graph of the consumed heap for the docdemo-serviceshows that the service calls different top-level frames, oneof them is the Go runtime'smain function. The width of thesetop-level frames show the majority of the heap is consumed by the call stackinvolving Go runtime'smain,application-specificmain,allocOnce, andallocImpl:

The root frame displays metric consumption information.
Hovering over a frame
When you hold the pointer over a frame in the flame graph, a frame tooltip opensand displays additional information about the frame:
- Function name
- Function filename
- Absolute usage and percentage usage
In the metric consumption information, the prefixtotal indicates that themetric-value and percentage are for a function and its children.In contrast, the prefixself indicates the metric-value and percentageare for the function with the consumption of its children excluded.
The dialog also includes buttons:
- Focus: Focuses the graph on the current frame's function.
- Show stacks: Adds a filter to only show thestacks that include this frame's function.
- Show history: Opens the history view for the frame's function.
In this example, the tooltip shows that theruntime.main functionis located in the/usr/local/go/src/runtime/proc.go file. Themetric consumption information shows thatruntime.main and its childrenconsume 54.73 MiB ofmemory, or about 98% of the total memory consumed by the program:

Selecting a frame
When you select a frame, the flame graph is redrawn with that frame shown fullwidth and the colors higher in the call stack are muted. Selecting on aframe doesn't change any settings, it only changes how the graph is displayed.To revert to the original view, select the root (top) frame.
In the following example, the pointeris on a tiny frame and it is difficult to view the call stack. The tooltipidentifies(*huffmanBitWriter).write as the frame function:

After you select the frame, the graph is redrawn, making the call stackmore visible:

Focus: Sort, select the frame with the labelSort.What's next
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-19 UTC.