From linux-debugging
Install and configure userspace OOM protection (systemd-oomd or earlyoom) so a desktop running out of memory kills the offending process before the kernel hard-locks the machine. Use when the user reports freezes under memory pressure, or proactively when setting up a new desktop. Ubuntu 22.04+ ships systemd-oomd by default; this skill verifies its config and falls back to earlyoom on older systems.
npx claudepluginhub danielrosehill/claude-code-plugins --plugin linux-debuggingThis skill uses the workspace's default tool permissions.
A Wayland desktop under heavy memory pressure (Chrome with 200 tabs, a runaway build, an LLM swallowing RAM) will freeze before the in-kernel OOM killer fires — the system thrashes swap and becomes unresponsive for minutes. Userspace OOM daemons watch pressure metrics (PSI) and kill earlier.
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Share bugs, ideas, or general feedback.
A Wayland desktop under heavy memory pressure (Chrome with 200 tabs, a runaway build, an LLM swallowing RAM) will freeze before the in-kernel OOM killer fires — the system thrashes swap and becomes unresponsive for minutes. Userspace OOM daemons watch pressure metrics (PSI) and kill earlier.
Check systemd version: systemctl --version | head -1
systemctl status systemd-oomd
systemd-cgls /sys/fs/cgroup/user.slice
oomctl
oomctl lists which cgroups are being watched. If empty, no slice has ManagedOOMSwap=kill or ManagedOOMMemoryPressure=kill set.
The Ubuntu default already enables ManagedOOMSwap=kill on user@.service. Verify:
systemctl cat user@.service | grep -i ManagedOOM
systemctl cat user.slice | grep -i ManagedOOM
If missing, drop in an override:
sudo systemctl edit user@.service
Add:
[Service]
ManagedOOMSwap=kill
ManagedOOMMemoryPressure=kill
ManagedOOMMemoryPressureLimit=50%
Reload and verify with oomctl.
Edit /etc/systemd/oomd.conf.d/local.conf:
[OOM]
SwapUsedLimit=90%
DefaultMemoryPressureLimit=60%
DefaultMemoryPressureDurationSec=20s
sudo apt install earlyoom
sudo systemctl enable --now earlyoom
Defaults: kill at 10% free RAM and 10% free swap. Tune in /etc/default/earlyoom:
EARLYOOM_ARGS="-r 60 -m 5 -s 5 --avoid '(^|/)(systemd|sshd|init|bash|kwin_wayland|plasmashell)$' --prefer '(^|/)(chrome|firefox|node|python)'"
-m 5 -s 5 = trigger at 5% free RAM and 5% swap. --avoid protects critical desktop processes; --prefer targets memory hogs first.
Stress test (use a VM or be ready to lose unsaved work):
stress-ng --vm 4 --vm-bytes 90% --timeout 60s
Then check what fired:
journalctl -u systemd-oomd -b --no-pager # path A
journalctl -u earlyoom -b --no-pager # path B
Report: