Memory leak: ArrayBuffers grow to 6.3GB in ~5 minutes (cc 2.1.72)
Summary
Claude Code process leaks memory rapidly via ArrayBuffers. Went from ~2GB to 6.5GB within minutes of normal usage.
Diagnostics
- cc version: 2.1.72
- Node: v24.3.0
- Platform: macOS (Darwin 24.0.0)
- Uptime at snapshot: 337 seconds (~5.6 min)
Memory breakdown
| Metric | Value |
|--------|-------|
| heapUsed | 7.16 GB |
| heapTotal (V8) | 65 MB |
| external | 7.11 GB |
| arrayBuffers | 6.35 GB |
| rss | 490 MB |
| Growth rate | ~5 GB/hour (~1.45 MB/s) |
Key observation
The V8 JS heap is healthy at 65MB. Nearly all memory is in external / arrayBuffers (6.35GB), indicating Buffer or ArrayBuffer instances are being allocated and never freed. This is not a JS object graph leak — it's a native memory / buffer retention issue.
Full diagnostics JSON
{
"timestamp": "2026-03-16T14:38:04.452Z",
"sessionId": "481cf019-5bae-41d2-8d22-1646d09c7453",
"trigger": "manual",
"dumpNumber": 0,
"uptimeSeconds": 337.358501417,
"memoryUsage": {
"heapUsed": 7165363765,
"heapTotal": 65052672,
"external": 7113590637,
"arrayBuffers": 6354633756,
"rss": 490471424
},
"memoryGrowthRate": {
"bytesPerSecond": 1453858.2011121192,
"mbPerHour": 4991.426013949995
},
"v8HeapStats": {
"heapSizeLimit": 7307264000,
"mallocedMemory": 7166150685,
"peakMallocedMemory": 730726400,
"detachedContexts": 0,
"nativeContexts": 1
},
"resourceUsage": {
"maxRSS": 748263833600,
"userCPUTime": 79160639,
"systemCPUTime": 9286570
},
"activeHandles": 0,
"activeRequests": 0,
"analysis": {
"potentialLeaks": [
"High memory growth rate: 4991.4 MB/hour"
],
"recommendation": "WARNING: 1 potential leak indicator(s) found. See potentialLeaks array."
},
"platform": "darwin",
"nodeVersion": "v24.3.0",
"ccVersion": "2.1.72"
}
Reproduction
Normal conversational usage (file reads, code edits, tool calls). No unusually large files or outputs.
Expected behavior
Memory should remain stable during a typical session, not grow at ~5GB/hour.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗