claude-code - 💡(How to fix) Fix [BUG] Memory leak: Claude Code RSS grows from 500MB to 4.6GB+ within minutes [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46931Fetched 2026-04-12 13:29:24
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×5commented ×2

Error Message

Error Messages/Logs

No error messages — the process silently consumes memory until the system runs out.

Code Example

No error messages — the process silently consumes memory until the system runs out.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Claude Code process consumes RAM continuously and grows unbounded (~500MB/minute) until the system runs out of memory. The process starts at ~500MB RSS but climbs to 4.6GB+ within 6 minutes of normal conversation. Running /exit immediately frees all memory. Restarting claude resets to ~500MB but the growth resumes immediately. This was not happening before — started recently.

What Should Happen?

Memory usage should stabilize after initial load, not grow unbounded at ~500MB/minute during a normal conversation.

Error Messages/Logs

No error messages — the process silently consumes memory until the system runs out.

Steps to Reproduce

  1. Run claude in any project directory
  2. Send a few normal messages (no large file reads, no MCP servers, simple text conversation)
  3. Monitor with ps aux | grep claude every 1-2 minutes
  4. Observe RSS growing ~500MB/minute:
    • Fresh start: 483 MB (3.0%)
    • ~2 minutes: 2.3 GB (14.5%)
    • ~4 minutes: 3.5 GB (21.7%)
    • ~6 minutes: 4.6 GB (28.8%)
  5. System RAM went from 4.8 GB → 9.0 GB used, solely from the claude process
  6. /exit immediately frees all memory back to normal

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Not sure of exact version, but this was not happening before updating to 2.1.100

Claude Code Version

2.1.100 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

  • No MCP servers configured
  • No hooks configured
  • Clean git repo (no uncommitted changes)
  • Node.js v25.8.0
  • Ubuntu Linux 25.04 (kernel 6.17.0-20-generic)
  • System RAM: 16GB
  • No other unusual processes running
  • The leak happens consistently across fresh sessions
  • Continuous network activity observed during the leak

extent analysis

TL;DR

The most likely fix for the memory leak issue in Claude Code is to revert to a previous version, as the problem started after updating to version 2.1.100.

Guidance

  • Investigate the changes made in version 2.1.100 to identify the potential cause of the memory leak.
  • Monitor the network activity during the conversation to see if it's related to the memory leak.
  • Try to reproduce the issue with a minimal conversation scenario to isolate the problem.
  • Consider reporting the issue to the developers with more detailed information about the memory usage and network activity.

Example

No specific code example can be provided without more information about the Claude Code internals.

Notes

The exact cause of the memory leak is unknown, and more investigation is needed to determine the root cause. The fact that the issue started after updating to version 2.1.100 suggests a regression, but without more information, it's difficult to provide a definitive fix.

Recommendation

Apply workaround: Revert to a previous version of Claude Code, as the memory leak issue started after updating to version 2.1.100. This is because the issue is likely a regression, and reverting to a previous version may resolve the problem until a fix is available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING