Plainnotes

tmpfs uses memory, not disk

2024-03-10 · 2 min readSystems

/dev/shm and /run look like directories but live in memory. Writes there never show up in df -h /, yet they consume RAM.

df -h /dev/shm

The default size is half of memory. A program that writes 2G of temporary files there can trigger the OOM killer while df insists the disk has room.

du -sh /dev/shm /run

Containers behave the same way: --shm-size defaults to 64M, and applications like Chrome or parallel PostgreSQL queries fail with No space left on device on a disk that is plainly not full.

tmpfs is fast, but it is volatile and counts against memory.