A terminal pane vanishes with no error: systemd-oomd killed its whole cgroup

Field note

This isn't the kernel OOM killer, so the kernel log has nothing. Search the full journal around the time it happened:

bash
journalctl --since "<5 min before>" --until "<after>" | grep -i -E 'oomd|oom-kill'

Mine showed:

text
Marked .../tmux-spawn-<id>.scope for killing due to memory used (31.0G/33.2G)
and swap used (23.2G/25.7G) being more than 90.00%
systemd-oomd killed 154 process(es) in this unit

SwapUsedLimit defaults to 90%, and oomd sends SIGKILL to all processes in the chosen cgroup. SIGKILL leaves no core dump and gives the application no chance to log anything. Every tmux pane is a separate tmux-spawn-*.scope, so one pane is one kill unit. Here it took 154 processes, while other panes in the same window kept running. The pane that died held 15.6G of swap, far more than any other.

The threshold is measured across the system, so the process that pushed swap over the line isn't necessarily the one that dies.