← Back to context

Comment by codedokode

3 days ago

> I mostly want to note that swap files can complicate hibernate.

Only in Linux - Windows has no problem with swap in a file. Swap partition is an awful idea because you cannot easily resize it.

Zram is also a bad idea, when it is filled, the system starts swapping to a disk, and old pages nobody needs are kept in RAM forever. Zswap is better in this aspect - old pages are pushed to the disk and newer ones kept in memory. But Linux distributions use zram by default.

Also, it seems that many distributions now place /tmp in RAM (tmpfs). Whoever made such decision is not very bright. When you place a large file in /tmp (for example, viewing a large compressed archive which is automatically unpacked into a temporary location), it fills the memory and the systems locks up completely, including mouse and GUI - because bright people developing Linux cannot think of reserving resources for desktop environment to prevent exactly this situation. Why reserve memory for GUI? Obviously files placed into /tmp are more important. Who needs GUI nowadays when you can easily connect over SSH from another machine and kill the misbehaving program.

If you are making a Linux distribution, do not place /tmp into memory. Or at least check how much RAM user has, and add a limit on tmpfs after which files are pushed onto the disk. Also, do reserve memory for window manager with high priority.