Analyzer tcmalloc-bin-distr

Name

tcmalloc-bin-distr - Distribution of Memory Usage across tcmalloc Size Classes and Page Heap

This analyzer captures the internal memory distribution statistics of the tcmalloc memory allocator. It reads tcmalloc’s runtime statistics to collect detailed information about memory usage across all size classes (bins), including in-use objects, free objects in thread caches, transfer caches, and central caches, as well as the overhead for each size class. It also collects page heap span distribution and overall memory summary (application usage, page heap freelist, central/transfer/thread cache freelists, and metadata). The analyzer generates two summary tables (overall memory stats and page heap span distribution) and a stacked bar chart showing the in-use vs. free memory breakdown across all tcmalloc size classes, helping identify memory fragmentation, cache bloat, and allocation hotspots in C/C++ applications using tcmalloc.

Resource Category

Memory.

Application Type & Technical Stack

  • All

Command Line Syntax

The analyzer can be invoked directly on the command-line via the orxray utility from the openresty-xray-cli software package.

Alternatively, the analyzer can also be invoked manually or automatically on the web console UI of OpenResty XRay (like on the Advanced web page).

# PID is the target process PID.
orxray analyzer run tcmalloc-bin-distr -p PID

# trace a shell command directly
orxray analyzer run tcmalloc-bin-distr -c SHELL_CMD

Tracing Multiple Processes

Not supported.

Output Formats

  • Stacked Bar Charts
  • Tables
  • Plain Texts

Author

The OpenResty Inc. Team.

Copyright (C) by OpenResty Inc. All rights reserved.