OOM crash under multi-subagent load: subagent CLI processes grow to ~6.5 GB RSS each; CliGovernor logs critical memory pressure for 8 min but evicts nothing (Linux, Desktop 1.17377.0 / CLI 2.1.187)
Summary
Under a multi-subagent workload (5–7 background agents over ~35 min), individual Claude Code CLI child processes grew to ~6.5 GB RSS each (plus 3–7.6 GB swapped, each). Four concurrent processes exhausted a 31 GB RAM + 20 GB swap Linux machine. The kernel OOM-killer selected the desktop app's NetworkService utility process (oom_score_adj 300), which fatally broke the Electron main process ("networking is broken until relaunch") — the user experiences this as the desktop app crashing. The app's own memory governor logged pressure at critical repeatedly for ~8 minutes before the kill and took no action each time.
Two distinct defects:
- CLI subagent memory ballooning — CC CLI subagent/session processes reaching ~6.2–6.7 GB RSS each (17 GB total-vm on the largest). Four concurrent = ~25.6 GB RSS + ~18.6 GB swap.
- CliGovernor takes no action at critical pressure — from 15:50:48 to 15:57 it logged a warning/critical pair every ~40–60 s, each time reporting "would evict 0 idle session(s), 1 effective", and never evicted, throttled, or surfaced anything to the user before the kernel intervened.
Environment
- Claude Code Desktop 1.17377.0, Electron 42.5.1, bundled CC CLI 2.1.187
- Pop!_OS (Linux 7.0.11-76070011-generic), 31 GB RAM + 20 GB swap, COSMIC desktop
- Workload: interactive session spawning 5–7 background subagents (Task tool fan-out) doing HTTP QA + file writes
Timeline (2026-07-03, CDT)
- 15:23 — app launch; heavy subagent fan-out session begins
- 15:50:48 — first
[CliGovernor] memory pressure (warning): would evict 0 idle session(s), 1 effective - 15:51:28 → 15:57 —
memory pressure (critical)+ same "would evict 0" line repeating every ~40–60 s - 15:58:21 — kernel OOM (free swap 180 kB of 20 GB); kills claude-desktop NetworkService (oom_score_adj 300)
- 15:58:22 — app log:
Network Service process gone (reason=killed, exitCode=15) outside app quit — main-process networking is broken until relaunch; Sentry event emitted (should exist server-side) - 15:58:42–15:59:09 — app auto-relaunches
- 15:58:51 — kernel kills the largest CLI process (6.8 GB anon-rss)
Key evidence (verbatim)
Kernel journal:
Jul 03 15:58:21 pop-os kernel: tokio-rt-worker invoked oom-killer: gfp_mask=0x140cca(...), order=0, oom_score_adj=0
Jul 03 15:58:21 pop-os kernel: Free swap = 180kB
Jul 03 15:58:21 pop-os kernel: Total swap = 20970996kB
Jul 03 15:58:21 pop-os kernel: [ 13123] 1000 13123 4253598 1663156 1662700 456 0 29573120 1987257 0 claude
Jul 03 15:58:21 pop-os kernel: [ 14644] 1000 14644 3204926 1679146 1678681 465 0 23130112 1166198 0 claude
Jul 03 15:58:21 pop-os kernel: [ 14852] 1000 14852 2680590 1625919 1625454 465 0 19800064 810017 0 claude
Jul 03 15:58:21 pop-os kernel: [ 14974] 1000 14974 3204910 1749861 1749398 463 0 21512192 908963 0 claude
Jul 03 15:58:21 pop-os kernel: Out of memory: Killed process 8799 (claude-desktop) total-vm:1530612248kB, anon-rss:318980kB, ... oom_score_adj:300
Jul 03 15:58:51 pop-os kernel: Out of memory: Killed process 13123 (claude) total-vm:17014392kB, anon-rss:6806964kB, ...
(rss column is pages: 1,663,156 pages ≈ 6.35 GB RSS; swapents 1,987,257 ≈ 7.6 GB swapped — per process.)
App log (~/.config/Claude/logs/main.log):
2026-07-03 15:50:48 [warn] [CliGovernor] memory pressure (warning): would evict 0 idle session(s), 1 effective
2026-07-03 15:51:28 [warn] [CliGovernor] memory pressure (critical): would evict 0 idle session(s), 1 effective
(warning/critical pair repeats every ~40–60s, 15:50 → 15:57)
2026-07-03 15:58:22 [error] Network Service process gone (reason=killed, exitCode=15) outside app quit — main-process networking is broken until relaunch
2026-07-03 15:58:53 [info] Starting app {
systemd user journal:
Jul 03 15:58:21 pop-os systemd[1531]: app-cosmic-claude-desktop-8422.scope: Failed with result 'oom-kill'.
Notes for triage
- No crashpad minidump (all Crashpad dirs empty) — expected, SIGKILL is uncatchable. A Sentry event fired at 15:58:22 with the NetworkService error; should be retrievable server-side.
- The 2.1.199 "background-agent daemon self-kill after unclean shutdown" bug is NOT implicated (daemon.log shows clean idle exit the prior evening, no respawn churn).
- Suggested fixes: (a) memory ceiling / recycling for CLI subagent processes; (b) CliGovernor should act at critical (evict, pause spawns, or at minimum surface a user-visible warning) rather than logging "would evict 0" — the governor had 8 minutes of runway; (c) consider oom_score_adj on CLI children so the kernel prefers them over the app's NetworkService (killing networking takes down the whole app; killing one subagent is recoverable).
Repro guidance
Long interactive session on Linux; fan out 4+ background subagents each doing sustained tool work (HTTP calls, file reads/writes) for 30+ min; watch ps -o pid,rss,etime,args -C claude — RSS climbs into multiple GB per process without release.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗