[BUG] Native memory leak (~1.5 GB/min RssAnon) in interactive mode — regression between 2.1.140 and 2.1.150
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?
In an interactive session the claude process RSS grows ~1.5 GB/min until it's OOM-killed (SIGKILL), freezing the desktop.
Measured via /proc/<pid>/status + smaps_rollup:
- RssAnon climbs 592 MB → 1731 MB in 45 s (~1.5 GB/min); RssFile stays flat (~111 MB) → anonymous/private-dirty, NOT
file-backed.
- NODE_OPTIONS=--max-old-space-size=512 is IGNORED (process sails past 3 GB) → growth is NOT in the V8 JS heap; it's
native/off-heap memory (native addon / ArrayBuffer / node-pty).
- Reproduces in an EMPTY folder with a CLEAN CLAUDE_CONFIG_DIR (zero stored sessions) → not ~/.claude/projects accumulation.
- Reproduces inside tmux → not specific to the terminal emulator.
- The same CLI running headless (non-interactive) does NOT leak.
2.1.140 is stable (~315 MB, flat); 2.1.150 and 2.1.156 both leak. Likely related: #46931, #32752, #32892, #56335.
What Should Happen?
RSS should stay bounded (as in 2.1.140, ~315 MB, and in headless runs) instead of growing unbounded until OOM.
Error Messages/Logs
# /proc/<pid>/status — two snapshots ~45 s apart, idle/light use:
RssAnon: 592xxx kB RssFile: 111xxx kB
RssAnon: 1731xxx kB RssFile: 112xxx kB
# NODE_OPTIONS=--max-old-space-size=512 → process still exceeds 3 GB (flag ignored)
# Process OOM-killed (SIGKILL) once RSS reaches available RAM
Steps to Reproduce
- Native install (claude.ai/install.sh), version 2.1.150 or 2.1.156.
- Start in an empty dir with a clean config:
mkdir -p /tmp/t && cd /tmp/t
CLAUDE_CONFIG_DIR=/tmp/empty-cfg claude
- In another terminal, watch RSS:
watch -n3 'grep -E "RssAnon|RssFile" /proc/$(pgrep -f claude|head -1)/status'
- RssAnon climbs ~1.5 GB/min; RssFile flat. Eventually OOM-killed.
Also reproduces inside tmux. Does NOT reproduce on 2.1.140 (stays ~315 MB).
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.140
Claude Code Version
2.1.156 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
- Install: native build via claude.ai/install.sh (~/.local/bin/claude); the native binary ignores NODE_OPTIONS.
- OS: Ubuntu, kernel 6.8.0-117-generic, x86_64; 16 GB RAM.
- Terminal: Ptyxis (GTK4/VTE, Wayland); also reproduced inside tmux.
- Asymmetry: same CLI runs fine headless on a 4 GB server with MANY stored sessions, while this 16 GB desktop with FEW sessions
leaks → not session-count related.
- Bisect: 2.1.140 (2026-05-12) clean; 2.1.150 (2026-05-23) leaks. CHANGELOG for 2.1.150 only says "Internal infrastructure
improvements"; no memory entry in 2.1.154–2.1.156. The 2.1.153 fix ("excessive memory when resuming by transcript path on
machines with many sessions") does NOT match this signature.
- Workaround: pinned 2.1.140 + DISABLE_AUTOUPDATER=1.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗