[BUG] v2.1.87 idle process grows ~500 MB/min, OOM-killed within minutes on 16GB WSL2 system
Summary
Claude Code v2.1.87 exhibits unbounded memory growth even when completely idle (no user input, no active tasks). A single idle process grows from ~350 MB to ~3.6 GB in under 5 minutes (~500 MB/min). Two concurrent processes (one Discord bot channel listener + one personal terminal) trigger the Linux OOM killer within 10-15 minutes.
This is a blocking issue for anyone running Claude Code as a long-running process (e.g., Discord bot via --channels).
Environment
- Claude Code version: 2.1.87
- OS: Windows 11 -> WSL2 (Ubuntu 24.04)
- Hardware: GEEKOM Mini PC, 16 GB RAM
- WSL config: 12 GB memory, 8 GB swap (
.wslconfig) - Node.js: v24.13.0
- Plugins enabled: 12 (discord, context7, superpowers, github, playwright, serena, etc.)
Measured Memory Growth (Single Idle Process)
Process started via tmux new-session -d -s test "claude --dangerously-skip-permissions" -- zero user input after launch.
| Time After Start | RSS (MB) | Notes |
|---|---|---|
| ~0s | ~350 | Initial startup |
| 30s | 1,220 | Already 1.2 GB |
| ~2 min | 2,103 | |
| ~2.5 min | 2,376 | |
| ~3 min | 2,658 | |
| ~3.5 min | 2,932 | |
| ~5 min | 3,607 | Still climbing |
Growth rate: ~500 MB/minute while completely idle.
Virtual memory allocation is 75 GB (VmSize: 75166384 kB) from the moment the process starts.
OOM Kill Logs
From dmesg and /var/log/syslog:
oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,
global_oom,task_memcg=/init.scope,task=claude,pid=1999,uid=1000
Out of memory: Killed process 1999 (claude)
total-vm:75099200kB, anon-rss:8060232kB, file-rss:384kB
Memory breakdown from /proc/PID/smaps_rollup:
Pss_Anon: 11059028 kB (10.5 GB anonymous heap)
Pss_File: 12779 kB
Private_Dirty: 11058740 kB
Nearly all memory is anonymous dirty pages -- heap allocations that are never freed.
Reproduction Steps
- Install Claude Code v2.1.87 on WSL2 (Ubuntu 24.04)
- Enable several plugins in
~/.claude/settings.json - Start Claude in tmux:
tmux new-session -d -s test "claude --dangerously-skip-permissions" - Do nothing. Don't type anything.
- Monitor:
watch -n 10 'cat /proc/$(pgrep -f "claude --danger" | head -1)/status | grep VmRSS' - Observe RSS growing ~500 MB/min
- On a 16 GB system, OOM kill within 10-20 minutes
Additional Observations
--bareflag does NOT prevent plugins from loading or reduce memory growth--settingsoverride with emptyenabledPluginsdoes NOT prevent plugins from spawning- The Discord plugin (
bun server.ts) launches even without--channelsflag - Chrome crashpad handlers spawn on every launch
- Related closed issues: #34161, #25545, #22188, #21403, #4953, #11315 -- all closed as dupes or Not Planned, none fixed
Impact
Makes Claude Code unusable as a long-running process. Only workaround is periodic restarts, which defeats the purpose of persistent sessions or background automation.
Expected Behavior
An idle Claude Code process should stabilize at a reasonable memory footprint (300-500 MB) and not grow without user activity.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗