Memory leak on Linux - RAM grows to 20GB+ causing system crash
Resolved 💬 4 comments Opened Jan 25, 2026 by Noammandelbaum Closed Jan 29, 2026
Description
Claude Code consumes excessive memory on Linux, growing to 20GB+ RAM usage during simple conversations, causing system crashes.
Environment
- Claude Code version: 2.1.15
- Node.js version: v24.13.0
- OS: Ubuntu Linux (kernel 6.14.0-37-generic)
- System RAM: 32GB
Steps to Reproduce
- Start Claude Code on Ubuntu Linux
- Have a simple conversation (just text, no large files or complex operations)
- Monitor memory usage with
ps aux | grep claude - RAM usage grows continuously to 20GB+ within minutes
Expected Behavior
Memory usage should remain reasonable (under 1-2GB) for simple text conversations.
Actual Behavior
- Memory usage grows to 20GB+ (61%+ of 32GB RAM)
- System becomes unresponsive and crashes
- This has caused 5+ system crashes
Additional Context
- This issue does NOT occur on Windows - the same user previously used Claude Code on Windows with only 4GB RAM without any issues
- Cache/history files are normal size (~83MB total in ~/.claude)
- The issue appears to be Linux-specific
- Workaround: Setting
NODE_OPTIONS="--max-old-space-size=5120"to limit memory
Workaround
Adding to ~/.bashrc:
export NODE_OPTIONS="--max-old-space-size=5120"
This prevents system crashes but Claude Code may crash when hitting the limit.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗