Memory Analysis¶
Memory leak detection and heap analysis for identifying memory issues.
Overview¶
Memory leaks cause applications to consume increasing amounts of RAM over time, leading to OOM kills and poor performance. perfetto-cli detects leaks by analyzing RSS growth trends and provides heap dominator tree analysis.
Commands¶
memory leak¶
Detect memory leaks via RSS growth trend analysis.
Options:
| Option | Description | Default |
|---|---|---|
--growth-threshold <MB/min> |
Minimum RSS growth rate to flag as leak | 5 |
memory heap¶
Heap dominator tree analysis — shows which objects are retaining the most memory.
Workflow¶
- Run
memory leakto check for abnormal RSS growth - If a leak is detected, run
memory heapto identify the retaining objects - Focus on objects with unexpectedly large retained sizes
Tips¶
- Lower
--growth-thresholdfor long-running traces to catch slow leaks - Heap analysis requires traces captured with heap profiling enabled
- Use
-f jsonto track memory metrics across multiple test runs