[BUG] Memory overflow: 184,763 MB/hour growth rate after 7.5s uptime
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
- Claude Code version: 2.1.72
- Node.js version: v24.3.0
- Platform: Linux
- Session ID: 843a585f-05fd-4ba3-a871-3f85641d8577
- Trigger: Manual diagnostics dump
- Symptoms: external memory at 357 MB + array buffers at 58 MB within 7.5 seconds of uptime; growth rate of
~53 MB/sec
843a585f-05fd-4ba3-a871-3f85641d8577-diagnostics.json
What Should Happen?
┌─────────────────┬─────────┬───────────────────────────────────────────┐
│ Metric │ Value │ Notes │
├─────────────────┼─────────┼───────────────────────────────────────────┤
│ Heap Used │ 390 MB │ Way above heap total (40 MB) — suspicious │
├─────────────────┼─────────┼───────────────────────────────────────────┤
│ Heap Total │ 40 MB │ Much smaller than heap used — anomalous │
├─────────────────┼─────────┼───────────────────────────────────────────┤
│ External Memory │ 357 MB │ Very high — likely the main culprit │
├─────────────────┼─────────┼───────────────────────────────────────────┤
│ Array Buffers │ 58 MB │ Contributing factor │
├─────────────────┼─────────┼───────────────────────────────────────────┤
│ RSS │ ~404 MB │ Total process memory │
└─────────────────┴─────────┴───────────────────────────────────────────┘
Root Cause Indicators
- external memory (357 MB) is the dominant consumer — this is memory allocated outside V8's heap (C++
addons, Buffers, native modules). This strongly points to a Buffer/stream leak or native addon issue.
- arrayBuffers (58 MB) is also elevated — likely tied to the same source (e.g., unfreed Buffer allocations
from streaming API responses).
- heapUsed > heapTotal (390 MB vs 40 MB) is anomalous — this can happen when external/native allocations
are counted in heapUsed but not heapTotal, further pointing to native/Buffer memory.
Likely Scenarios in Claude CLI
- Streaming response buffers not being released — if API response chunks are accumulated without being
garbage collected.
- A large file or conversation context being held in memory (e.g., repeated reads or large tool outputs
buffered in native memory).
- Node.js v24.3.0 + Claude Code v2.1.72
Error Messages/Logs
Steps to Reproduce
Just on opening of my cli terminal im met with a memory overflow
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.72
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗