Open general

In-workspace memory watchdog: warn at 80 percent, name the top consumer, protect infrastructure via oom_score_adj

Drew Owens · 19d ago

Type: Feature request

Context: On 2026-07-20 a single Claude Code process grew to 15.2 GB, filled the workspace's ~15 GB WSL2 ceiling, and was killed by the kernel OOM-killer (bug report filed separately). Nothing warned the user while usage climbed. The first signal was the session dying.

Ask: a lightweight memory watchdog inside the workspace distro that warns before the kernel has to kill anything.

Sketch:

  • A small daemon (or a timer job in the existing workspace-updater) samples /proc/meminfo and per-process RSS every 10-15 s. Cost is negligible.
  • Warn at ~80 percent: toast via HD ("Workspace memory at 82 percent. Largest process: claude, 11.4 GB") so the user can save work or kill the runaway themselves.
  • Act at ~92 percent (optional, configurable): name the top consumer and offer a one-click kill, rather than letting the kernel choose a victim at 100 percent. The kernel picked correctly this time (the runaway was also the biggest task), but it could just as easily have taken out code-server.
  • Adjust OOM priorities: set oom_score_adj so infrastructure (code-server, the session keeper, adom-desktop serve) is protected and user workloads are preferred victims. Cheap, static, and would have produced the same outcome here by design instead of by luck.
  • Log every sample crossing the warn threshold to a file the crash logger (proposal filed alongside) can pick up post-mortem.

Delivery path: the watchdog belongs in the distro image or hd-workspace-tooling so every HD workspace gets it; HD supplies the toast surface it already has.

1 Reply

John Lauer · 7d ago

Status (2026-08-03): still wanted, not yet built. Queued for the golden-image/tooling roadmap alongside the v23 bake rather than HD-side work; the toast surface it needs already exists. Keeping open.

Log in to reply.