[BUG] Memory leak: RSS grows continuously (~1GB/min) with zero user interaction after session start
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Environment
- OS: Ubuntu, Linux 6.8.0-101-generic
- Display: Wayland (GNOME)
- Claude Code version: 2.1.69
## Behaviour
After starting a new Claude Code session, the process RSS grows continuously
and without stopping even when the user is completely idle (no typing, no tool
calls, no interaction of any kind).
## Measurements
Observed growth over ~2 minutes of zero interaction:
- Fresh session start: ~860 MB RSS
- After 1 minute idle: ~7 GB RSS
- After 2 minutes idle: ~11.8 GB RSS
- Process: fully idle, no user input, no tool calls
Memory profile at time of measurement:
- Anonymous heap: 7,066 MB (nearly all RSS is anonymous — not file-backed)
- Swap used: 0 MB
- Open file descriptors: 63
- TCP connections: ~10
- Child processes: 1
## Impact
System became unresponsive. Swap began filling. Required manual kill of
process.
Previous session (same behaviour) consumed 60% of 14 GB RAM before being
killed.
## Reproduction
- Start a Claude Code session (
claude --resumeor fresh session) - Start a conversation (e.g. read a large file)
- Stop interacting entirely
- Watch RSS with: `watch -n 2 'ps -p $(pgrep -f "^claude" | head -1) -o
pid,rss --no-headers'`
- RSS climbs continuously with no user action
## Notes
- Killing and restarting the process reclaims all memory immediately
- No hooks active
- Growth occurs regardless of whether the session has prior conversation
history
What Should Happen?
No memory leaks :)
Error Messages/Logs
Steps to Reproduce
Start a session.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.69
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗