Memory leak: extreme growth rate in external/arrayBuffers from session start
Resolved 💬 4 comments Opened Mar 12, 2026 by poeks Closed Apr 9, 2026
Description
Claude Code shows an extreme memory growth rate starting from the very beginning of a session. Two separate /heapdump snapshots were taken within ~2 minutes of session start, both showing massive memory usage dominated by external memory and arrayBuffers.
Environment
- Platform: Linux (Ubuntu 24.04)
- Node.js: v24.3.0
- Claude Code version: 2.1.72 (also reproduced after updating to 2.1.74)
- Shell: zsh
Diagnostics
Session 1 (uptime: 106 seconds)
{
"uptimeSeconds": 106.37,
"memoryUsage": {
"rss": 2077622272,
"heapUsed": 4556004637,
"heapTotal": 57977856,
"external": 4512361213,
"arrayBuffers": 4108542877
},
"memoryGrowthRate": {
"mbPerHour": 67058.9
}
}
Session 2 (uptime: 115 seconds)
{
"uptimeSeconds": 115.80,
"memoryUsage": {
"rss": 3422146560,
"heapUsed": 3420422919,
"heapTotal": 54810624,
"external": 3379683079,
"arrayBuffers": 3038033147
},
"memoryGrowthRate": {
"mbPerHour": 101455.1
}
}
Analysis
externalmemory (~3-4 GB) vastly exceedsheapTotal(~55-58 MB), which is highly abnormalarrayBuffersaccount for the majority ofexternalmemory — this suggests streaming response buffers or similar binary data is not being released- Growth rate of 67,000–101,000 MB/hour within the first 2 minutes indicates a leak from the very start of the session, not gradual accumulation
/heapdumpdiagnosis confirms:"WARNING: 1 potential leak indicator(s) found"
Reproduction
- Start a new Claude Code session
- Run
/heapdumpwithin 2 minutes - Observe
externalandarrayBuffersalready in the gigabyte range with extreme growth rate
Impact
On a system with 8 GB RAM, Claude Code consumes 2–3 GB within 2 minutes, making it unusable for extended sessions.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗