Memory leak: Working Set grows ~3.5 GB/min during active session (Windows)

Resolved 💬 2 comments Opened Mar 12, 2026 by Demeger Closed Apr 10, 2026

Environment

| | |
|---|---|
| Claude Code version | 2.1.72 |
| Node.js | v24.12.0 |
| OS | Windows 11 Pro 10.0.26200 (Build 26200) |
| RAM | 15.5 GB total |
| Shell | bash (Git Bash / MSYS2) |
| Executable | %USERPROFILE%\.local\bin\claude.exe |

Description

The claude.exe process continuously leaks memory during an interactive session. Working Set grows unboundedly at ~3.5 GB/min during active tool use, exhausting all available RAM within minutes.

Measured memory growth (5 sessions, all confirmed)

Monitored via PowerShell (Get-Process) every 10 seconds.

Session 1 (PID 3800):

| Time | Working Set | Virtual Memory | Uptime |
|------|-------------|----------------|--------|
| 14:20:29 | 753 MB | 12,075 MB | 1.0 min |
| 14:21:09 | 1,943 MB | 13,310 MB | 1.7 min |
| 14:21:49 | 4,863 MB | 16,164 MB | 2.4 min |
| 14:22:29 | 7,216 MB | 18,501 MB | 3.0 min |
| 14:23:19 | 10,562 MB | 21,896 MB | 3.9 min |

+9,809 MB in 2 min 50 sec ≈ 3.5 GB/min

Session 2 (PID 14748) — stable for ~2.5 min, then leak starts:

| Time | Working Set | Uptime |
|------|-------------|--------|
| 14:23:39 | 579 MB | 0.1 min |
| 14:26:00 | 706 MB | 2.5 min |
| 14:26:40 | 1,519 MB | 3.1 min |
| 14:27:30 | 3,036 MB | 3.9 min |

Session 3 (PID 10228):

| Time | Working Set | Uptime |
|------|-------------|--------|
| 14:32:00 | 466 MB | 0.0 min |
| 14:32:50 | 1,073 MB | 0.9 min |
| 14:33:50 | 2,523 MB | 1.9 min |
| 14:34:20 | 3,250 MB | 2.4 min |

Session 4 (PID 19052) — WS plateaus but VM explodes:

| Time | Working Set | Virtual Memory | Uptime |
|------|-------------|----------------|--------|
| 14:35:40 | 576 MB | 12,089 MB | 0.1 min |
| 14:36:41 | 2,142 MB | 13,513 MB | 1.1 min |
| 14:37:21 | 3,941 MB | 16,635 MB | 1.8 min |
| 14:37:31 | 3,961 MB | 18,451 MB | 1.9 min |
| 14:38:21 | 4,153 MB | 30,024 MB | 2.8 min |
| 14:39:21 | 5,224 MB | 45,558 MB | 3.8 min |

VM grew from 12 GB to 45 GB while WS plateaued around 4 GB — objects appear to be paged out but not freed.

Session 5 (PID 13588):

| Time | Working Set | Uptime |
|------|-------------|--------|
| 14:40:41 | 554 MB | 0.0 min |
| 14:42:01 | 1,377 MB | 1.4 min |
| 14:43:12 | 5,598 MB | 2.6 min |
| 14:43:32 | 6,708 MB | 2.9 min |

Baseline after restart

New session consistently starts at ~530–580 MB WS. The leak is in the session runtime, not the binary itself.

To reproduce

  1. Start claude on Windows in any project directory
  2. Have a normal interactive session (file reads, bash commands, tool calls)
  3. Monitor memory:
while ($true) {
    $p = Get-Process -Name claude -EA SilentlyContinue
    if ($p) { "$(Get-Date -f HH:mm:ss)  WS: $([math]::Round($p.WorkingSet64/1MB,1)) MB" }
    Start-Sleep 10
}
  1. Observe Working Set growing continuously with no upper bound

Impact

  • Session becomes unusable within 3–5 minutes on a 16 GB machine
  • System RAM exhausted (only 1.1 GB free from 15.5 GB total after one session)
  • Must kill the process manually; all in-progress work is lost
  • Reproducible every session, regardless of task type

Hypothesis

Conversation context and tool result history appear to accumulate in the Node.js heap without being freed. Context compression happens on the model side, but the corresponding JS objects in the process are not released. The VM explosion pattern in Session 4 suggests objects are kept alive (preventing GC) and eventually paged to disk.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗