Work out tmpfs sizing instantly with clear inputs, formula shown and shareable results.
tmpfs lives in RAM and page cache, so its contents compete directly with application memory and can be pushed into swap. The size option is a ceiling, not a reservation, which is what makes the default of half of RAM dangerous: a process filling /dev/shm or /tmp can starve applications and trigger the OOM killer.
tmpfs sizing
limit = RAM x configured share; peak demand = application RAM + peak tmpfs usage; headroom = RAM - demand
Yes, pages can be swapped out under pressure, which is why it does not immediately cause OOM but does cause severe slowdowns.
It is fast and self-cleaning on reboot, which suits most systems. Avoid it where builds or uploads write multi-gigabyte temporary files, or set a conservative size limit.