V8 OOM: Claude Code CLI leaks memory until laptop crashes (113GB observed)
Bug Report
Summary
Claude Code CLI node process leaks memory unboundedly during sessions, eventually consuming all system RAM and crashing the machine. Observed 113.66 GB memory usage from Terminal (housing the claude CLI process) on a 24 GB MacBook, causing macOS to display "Your system has run out of application memory" and force-pause all applications. This has happened 6+ times, requiring hard restarts each time.
Environment
- macOS: 26.4.1 (25E253) — Darwin 25.4.0
- Machine: Mac16,12 (Apple Silicon, arm64), 24 GB RAM
- Node: v24.10.0 (arm64, Homebrew)
- Claude Code: latest (installed via npm)
- MCP servers active: context7, brightdata (SSE), playwright, filesystem, github
Crash Evidence
macOS Force Quit dialog showing memory usage:
| App | Memory |
|-----|--------|
| Terminal (claude CLI) | 113.66 GB |
| Claude desktop app | 1.02 GB |
| Google Chrome | 324 MB |
| Everything else | < 300 MB |
Crash report (node-2026-05-04-225553.ips) confirms V8 OOM:
exception: EXC_CRASH / SIGABRT
termination: Abort trap: 6
Stack trace:
node::OOMErrorHandler(char const*, v8::OOMDetails const&)
v8::Utils::ReportOOMFailure(v8::internal::Isolate*, ...)
v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, ...)
v8::internal::Heap::FatalProcessOutOfMemory(char const*)
v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double)
v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector, ...)
v8::internal::Heap::CollectGarbage(...)
The V8 garbage collector repeatedly failed to reclaim memory (CheckIneffectiveMarkCompact), indicating a genuine memory leak — not just high usage.
Steps to Reproduce
- Start
claudeCLI in Terminal - Use it for an extended session (the process grows continuously)
- System eventually runs out of memory and macOS force-pauses everything or the machine locks up
Impact
- Severity: Critical — crashes the entire machine, not just the CLI
- Frequency: 6 out of 6 sessions for this user
- Data loss risk: Unsaved work in other applications is lost on each crash
Workaround
Setting NODE_OPTIONS="--max-old-space-size=4096" in shell profile caps V8 heap and prevents the machine crash, but doesn't fix the underlying leak.
Expected Behavior
The CLI should have stable memory usage over long sessions, or at minimum self-terminate gracefully before consuming all system RAM.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗