analyze_gc_pressure
Analyze V8 CPU profiles to determine if garbage collection is the bottleneck. Reports GC time by type, flags excessive GC, and recommends targeted fixes for allocation pressure.
Instructions
Analyses a V8 .cpuprofile for garbage collection overhead. Reports total GC time as a percentage of profiling duration, broken down by GC type (Scavenger = short-lived object pressure, Mark-Sweep/Mark-Compact = old-space pressure, Incremental = high allocation rate). Flags when GC exceeds a configurable threshold and provides a targeted recommendation. Use to answer: is GC the bottleneck, and what kind of allocation pattern is causing it?
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile_path | Yes | Absolute path to the .cpuprofile file | |
| threshold_percent | No | GC percentage above which exceeds_threshold is set to true and a warning is emitted (default: 10) |