Skip to content

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

Closed as duplicate

Description

@MtlDev

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:

  • Claude Code Memory Leak - Process Grows to 120+ GB RAM and Gets OOM Killed #4953: Process grows to 120GB RAM before OOM kill

  • [BUG] #7985: Claude using 518GB RAM reported

  • [Bug] Memory Leak When Initializing Sub-Agent Orchestration #7020: Memory leak with sub-agent orchestration (450MB→30GB+)

  • [BUG] Claude Code frozen at startup - suspected memory leak. #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//.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//.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1679:1010)\n
at async QO
(file:///home//.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:30497)\n
at async file:///home//.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//.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//.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1679:1010)\n
at async QO
(file:///home//.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:30497)\n
at async file:///home//.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//.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//.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1679:1010)\n
at async Eh6
(file:///home//.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:3162:21927)\n
at async TFB
(file:///home//.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:3162:18069)\n
at async U2B
(file:///home//.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:31030)\n
at async Z8B
(file:///home//.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1907:1967)\n
at async qh6
(file:///home//.nvm/versions/node/v23.5.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:3162:17262)\n
at async Uh6 (file:///home/

Note: Error logs were truncated.

Activity

  1. github-actions commented on Sep 29, 2025

    @github-actions

    Found 3 possible duplicate issues:

    1. Claude Code Memory Leak - Process Grows to 120+ GB RAM and Gets OOM Killed #4953
    2. [Bug] Memory Leak When Initializing Sub-Agent Orchestration #7020
    3. [BUG] #7985

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  2. added
    duplicateThis issue or pull request already exists
    and removed
    bugSomething isn't working
    has reproHas detailed reproduction steps
    platform:linuxIssue specifically occurs on Linux
    on Oct 3, 2025
  3. github-actions commented on Oct 3, 2025

    @github-actions

    This issue has been automatically closed as a duplicate of #4953.

    If this is incorrect, please re-open this issue or create a new one.

    🤖 Generated with Claude Code

  4. github-actions commented on Oct 10, 2025

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  5. locked as resolved and limited conversation to collaborators on Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

duplicateThis issue or pull request already exists

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions