[Bug] Critical Memory Leak in v2.0.0 Causing 26GB Process Allocation

Resolved 💬 3 comments Opened Sep 29, 2025 by MtlDev Closed Oct 3, 2025

Bug Description
● Claude v2.0.0 Critical Memory Leak Summary

Issue: Claude Code v2.0.0 has a severe memory leak causing crashes and system instability.
Each Claude process allocates 26GB virtual memory on a system with only 16GB physical
RAM, causing swap thrashing and freezes.

Version: v2.0.0 (regression - previous version worked perfectly)System: Ubuntu Linux
22.04, kernel 6.8.0-84-genericFrequency: 5 crashes in one day after v2.0.0 update

Symptoms:

  • Claude UI completely freezes when running parallel Task() agents
  • Orphaned processes remain after force-close, unresponsive to SIGTERM
  • Each process consumes 26GB virtual memory (VSZ)
  • 2,509 accumulated todo files in ~/.claude/todos/

Root Cause:

Memory management bug triggered by parallel agent execution in v2.0.0. The issue manifests
when launching multiple Task() tools simultaneously, causing exponential memory growth.

Related GitHub Issues:

  • #4953: Process grows to 120GB RAM before OOM kill
  • #7985: Claude using 518GB RAM reported
  • #7020: Memory leak with sub-agent orchestration (450MB→30GB+)
  • #3282: Frozen at startup with memory leak

Evidence:

PID VSZ RSS Process
259337 26812636 533752 claude
306812 26920856 620464 claude
364670 26717184 395724 claude

Impact:

  • Complete work stoppage during complex multi-agent workflows
  • System instability requiring manual process cleanup (kill -9)
  • Data loss from crashed sessions

Workarounds:

  1. Avoid parallel Task() operations
  2. Periodically restart Claude before memory exhaustion
  3. Monitor with watch 'ps aux | grep claude'
  4. Force-kill orphaned processes with kill -9

Status: Known critical bug affecting multiple users. Report filed at
https://github.com/anthropics/claude-code/issues

Urgency: CRITICAL - Makes Claude unusable for complex workflows that previously worked.

Environment Info

  • Platform: linux
  • Terminal: alacritty
  • Version: 2.0.0
  • Feedback ID: 5bb51389-80e2-4d53-8da9-2965bdff0cd7

Errors
[{"error":"MaxFileReadTokenExceededError: File content (90192 tokens) exceeds maximum allowed tokens (25000). Please
use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific
content.\n at dBB
(file:///home/<redacted>/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1684:404)\n
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call
(file:///home/<redacted>/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1679:1010)\n
at async QO
(file:///home/<redacted>/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:30497)\n
at async file:///home/<redacted>/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1757:13
22","timestamp":"2025-09-29T20:23:54.759Z"},{"error":"MaxFileReadTokenExceededError: File content (90192 tokens)
exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file,
or use the GrepTool to search for specific content.\n at dBB
(file:///home/<redacted>/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1684:404)\n
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call
(file:///home/<redacted>/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1679:1010)\n
at async QO
(file:///home/<redacted>/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:30497)\n
at async file:///home/<redacted>/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1757:13
22","timestamp":"2025-09-29T20:24:25.681Z"},{"error":"MaxFileReadTokenExceededError: File content (90192 tokens)
exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file,
or use the GrepTool to search for specific content.\n at dBB
(file:///home/<redacted>/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1684:404)\n
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call
(file:///home/<redacted>/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1679:1010)\n
at async Eh6
(file:///home/<redacted>/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:3162:21927)\n
at async TFB
(file:///home/<redacted>/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:3162:18069)\n
at async U2B
(file:///home/<redacted>/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:31030)\n
at async Z8B
(file:///home/<redacted>/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1907:1967)\n
at async qh6
(file:///home/<redacted>/.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:3162:17262)\n
at async Uh6 (file:///home/<redacted>

Note: Error logs were truncated.

View original on GitHub ↗

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