Skip to content

VS Code Extension Host RAM Investigation, Console, 2026-05-04 16:10 CDT

TL;DR

Extension host is not the dominant leaker right now. After 1h 19m uptime, the Remote-SSH extensionHost tree on Console totals roughly 600 MB RSS, of which the anthropic.claude-code-2.1.126 native binary alone is 256 MB. That is a real leak vector (256 MB in 79 min, ~3.2 MB/min trend) but it is dwarfed by 11 long-running standalone claude CLI sessions in tmux that consume 3.5 GB+ combined. Console is stable: 5.47 GB used / 11.96 GB total, 6.48 GB available, swap untouched. No bounce needed yet.

Current RSS table

Sampled ps -eo pid,rss,etime,args, filtered to VS Code extension-host tree and top-RSS claude processes.

PID RSS (MB) Elapsed Process
2993136 345 1:19:27 extensionHost (--type=extensionHost --transformURIs)
2993980 256 1:19:25 anthropic.claude-code-2.1.126 native binary (extension child)
2992846 113 1:19:28 server-main.js (VS Code server root)
2993007 79 1:19:27 bootstrap-fork --type=fileWatcher
2994076 70 1:19:24 context-mode plugin (parented to claude-code ext, not ext-host)
2993165 70 1:19:27 bootstrap-fork --type=ptyHost
2993790 65 1:19:27 json-language-features (jsonServerMain)
2993177 63 1:19:27 openai.chatgpt (codex) app-server
2993159 63 1:19:27 markdown-language-features (serverWorkerMain)
VS Code subtree total ~1024

For contrast, top non-VS-Code memory hogs:

PID RSS (MB) Elapsed What
9858 426 31h 25m home-base_Opus47 tmux claude (Opus 4.7)
2940196 425 1h 46m spawn claude (Opus 4.7)
3099371 408 12m spawn claude (Opus 4.7)
2959082 398 1h 36m spawn claude (Opus 4.7)
2919529 377 1h 54m spawn claude (Opus 4.7)
3125285 370 14s spawn claude (just launched)
3124412 359 39s spawn claude (just launched)
3114663 351 5m spawn claude (Opus 4.7)
2928223 243 1h 51m spawn claude
740 99 31h 29m Xvfb (browser stream)
1087 83 31h 29m dockerd

11 standalone claude processes total ≈ 3.6 GB RSS.

System memory snapshot

total      used      free   available   swap-used
11961 MB   5474 MB   833 MB   6486 MB    0 / 4095 MB

Healthy. The 833 MB free figure is misleading because Linux uses 5987 MB for buffer/cache; 6486 MB available is the number that matters. Swap untouched.

Suspect ranking

  1. anthropic.claude-code-2.1.126 native binary (PID 2993980) — 256 MB after 79 min, parented to extensionHost. This is the IDE-side Claude Code extension that proxies to the CLI. It loads context-mode plugin children too. Highest leak velocity per minute observed (~3.2 MB/min). Primary suspect.
  2. extensionHost itself (PID 2993136) — 345 MB. Hosts claude-code, codex (openai.chatgpt), and Microsoft language features. Hard to attribute the 345 MB without v8 heap snapshot.
  3. codex (openai.chatgpt) extension — only 63 MB, low-suspicion at this point.
  4. json-language-features / markdown-language-features — 63-65 MB each, these are normal.

The handoff flagged claude-code 2.1.126 + codex + json-language-features. Of those, claude-code is the only one with leak-worthy growth so far; codex and json-LF are sitting at typical idle baselines.

Why this isn't urgent

  • 6.48 GB available, 0 swap used, no OOM events in journalctl -k --since "2 hours ago" | grep -i "killed process\|oom" (not run yet but free shows no pressure).
  • The bigger risk to Console is the 11 concurrent claude tmux spawns at 3.6 GB combined, not the extension host.

Repro / monitoring steps

To watch the leak grow without bouncing anything:

# RSS trend for extensionHost + claude-code binary, sampled every 60s
while :; do
  ts=$(date +%H:%M:%S)
  ps -eo pid,rss,comm | awk -v ts="$ts" '
    /extensionHost|claude/ {sum+=$2; n++}
    END {printf "%s  ext-host-tree-rss-kb=%d  procs=%d\n", ts, sum, n}'
  sleep 60
done | tee -a /home/justinwieb/forge/logs/ext-host-rss-trend.log

Per-pid trend for the top two suspects:

watch -n 30 'ps -p 2993136,2993980 -o pid,rss,etime,comm'

If claude-code extension binary crosses ~600 MB or extensionHost crosses ~800 MB while VS Code is idle (no active session), that confirms a real leak vs. expected working-set growth from the active home-base session feeding it.

Tier 1, do now (zero disruption): - Start the RSS trend logger above so we have data the next time this is investigated. - Reap orphan claude tmux sessions: /sessions list then kill any that are no longer needed. The 11-session pile is the real RAM hog. The orphan-claude reaper timer (forge-reap-orphan-claudes.timer) only kills claudes whose tmux was archived; explicitly idle but un-archived sessions slip past it.

Tier 2, when convenient (mild disruption, kills VS Code Remote session): - Bounce the extension host via VS Code command palette, "Developer: Restart Extension Host". Keeps the Remote-SSH session alive, just resets extensionHost children. Will drop the running claude-code IDE chat (PID 2993980) and force re-fork. - Confirm by re-running the snapshot above; expect claude-code binary RSS to drop to ~80-100 MB fresh.

Tier 3, if leak repeats post-bounce: - Pin claude-code extension version: downgrade to last known-good (check ~/.vscode-server/extensions/extensions.json history) and report upstream at github.com/anthropics/claude-code with the RSS trend log. - Consider disabling codex (openai.chatgpt) for an A/B run; its 63 MB is small but it's another extension-host child that could compound.

Do not restart the whole code-server process; that nukes the SSH session and every terminal Justin has open in Code.

Open questions

  • Is the 256 MB in anthropic.claude-code-2.1.126 a real leak, or just working-set growth from this very investigation feeding it through the IDE? The RSS trend logger above will answer this within 10-15 min of idle.
  • Does the leak track with number of /spawn invocations? Plausible: each spawn registers a tmux child the extension may be tailing.

Sign-off

Diagnosis only, no processes touched. Trend logger ready to start on request. [Claude Code, home-base_Opus47]