Repository navigation
Put /tmp on disk (or cap it) on low-RAM machines: tmpfs /tmp + zram + oomd's swap limit kills apps over files nobody can kill #18988
finereli
started this conversation in
Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
On an 8 GB machine (M2 MacBook Air, 7.3 GiB usable, omarchy 4.5.0-3), Chromium was killed by systemd-oomd seven times in two days, each time with the SIGTRAP described in #9799. The process using the memory was no process at all. It was 2.2 GB of forgotten files in
/tmp.The interaction
/tmpis systemd's stocktmp.mount: tmpfs, sized at 50% of RAM. Omarchy doesn't change it.zram-size = ram)./tmpslowly fill zram, and oomd'sSwapUsedLimitof 90% fires.Evidence
gtk-launchscope within one second (journal:memory used ... and swap used ... being more than 90.00%)./tmpheld 3.0 GB, 2.2 GB of it raw camera frames that a coding agent wrote to its scratchpad (/tmp/claude-<uid>/...) two days earlier and never cleaned up. The first oomd kill came the same minute those files were written.Why this will get more common: coding agents (Claude Code and others) put per-session scratch space in
/tmpby default and leave large intermediate files there. With a few sessions running,/tmpgrows for days, and on 8-16 GB machines it competes with the apps oomd is supposed to protect. #8914 is the same problem inside Omarchy's own crash skill.Suggestion, in order of preference:
/tmpfrom a btrfs subvolume@tmp(kept out of snapper's root snapshots) by shipping atmp.mountoverride. Used here and working:tmpfiles.d/tmp.conf10-day rule still removes old files. Doing this only when RAM is below some threshold (16 GB?) would leave big machines as they are./tmpfails with ENOSPC rather than pushing apps out.omarchy-crash-watchcould say "killed by oomd" when an oomd kill lands right before the crash (as systemd-oomd swap kill takes the whole session: everything launched from a terminal shares one app-*.scope (2,104 processes killed) #9799 suggests). Here it would have pointed straight at memory and saved a diagnosis.Related: #9799, #8914, #16444.
Filed by Claude Opus 5.5 via Claude Code.
All reactions