[BUG] Memory leak in Claude Code v2.1.72 — ArrayBuffers growing to 9.8GB at 50GB/hour on Windows
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?
Environment
- Claude Code version: 2.1.72
- Node.js version: v24.3.0
- OS: Windows 11 (win32)
- Launch scope: Multi-project parent directory
Description
Claude Code exhibits a severe memory leak where memory grows at ~50 GB/hour,
primarily driven by ArrayBuffers never being released. The process becomes
unusable within minutes and risks crashing the system.
Memory Dump (manual trigger, ~4 minutes after launch)
{
"timestamp": "2026-03-12T05:00:09.265Z",
"sessionId": "6d9a052b-c5be-41e8-8648-4f1f0b68a564",
"uptimeSeconds": 259.26,
"memoryUsage": {
"heapUsed": 10212301077,
"heapTotal": 53487616,
"external": 10183522101,
"arrayBuffers": 9878130989,
"rss": 3783856128
},
"memoryGrowthRate": {
"bytesPerSecond": 14594914.54,
"mbPerHour": 50107.66
},
"v8HeapStats": {
"heapSizeLimit": 34011959296,
"mallocedMemory": 10220429445,
"peakMallocedMemory": 3790102528
}
}
Key Observations
arrayBuffersreached 9.87 GB within ~4 minutes of launchexternalmemory at 10.18 GB suggests large file contents buffered outside V8 heap- Growth rate of 50,107 MB/hour will exhaust system RAM quickly
heapUsed(10.2 GB) vastly exceedsheapTotal(53 MB) — unusual mismatch
Steps to Reproduce
- Launch Claude Code from a parent directory containing multiple projects
- Let it run idle for a few minutes
- Observe memory usage in Task Manager or via memory dump
What I've Already Tried
- Added
.claudeignorewith**/node_modules/,**/obj/,**/bin/,
**/dist/, **/android/, **/ios/, and common binary file extensions
- Memory usage remained the same after
.claudeignorewas added - Restarting the session temporarily resets memory but leak resumes immediately
Expected Behavior
Memory usage should stay in the 200–500 MB range during normal usage.
Actual Behavior
Memory grows at ~50 GB/hour driven by unreleased ArrayBuffers,
reaching 10+ GB within minutes.
Suspected Cause
Claude Code appears to be reading large files or streaming directory contents
into ArrayBuffers without releasing them, possibly during the initial
indexing/scanning phase when launched from a large multi-project directory.
11adc8b4-5a42-4155-b480-b0a95c4bb11e-diagnostics.json
What Should Happen?
Expected Behavior
- Memory usage should stabilize between 200–500 MB after
initial directory indexing
- ArrayBuffers should be released after file scanning completes
- Memory growth rate should be negligible during idle sessions
.claudeignorepatterns should prevent excluded folders
from being buffered into memory entirely
Actual Behavior
- Memory never stabilizes — grows continuously even at idle
- ArrayBuffers reach 9.87 GB within ~4 minutes of launch
- External memory reaches 10.18 GB with no signs of release
- Growth rate of 50,107 MB/hour risks crashing the system
.claudeignorehas no measurable effect on memory consumption- Total observed memory: ~23.9 GB reported in Task Manager
Error Messages/Logs
Steps to Reproduce
Steps to Reproduce
- Open Windows Terminal and navigate to a parent directory
containing multiple projects (e.g., C:\Users\<user>\projects)
- Launch Claude Code from the parent directory:
claude .
- Let the session run idle — no prompts or commands needed
- After ~2–4 minutes, observe memory usage in Task Manager
(search for node.exe)
- Optionally trigger a manual memory dump to confirm:
- Look for the dump file in your Claude Code session directory
- Observe
arrayBuffersandexternalmemory growing rapidly
with no upper bound
Additional Trigger Conditions
- Issue occurs even with a
.claudeignorefile present - Issue reproduces on a fresh session immediately after restart
- No active prompts or file operations needed — leak occurs at idle
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
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗