Linux memory management

Improving memory by using compression

zram (compressed RAM-based block devices) can be used to set up swap space backed by compressed RAM.

This sounds counter-intuitive but the benefits gained by compressing infrequently-accessed memory pages (so they take up less space) seem to outweigh the downsides of not compressing at all, or writing them out to swap-on-disk: https://fedoraproject.org/wiki/Changes/SwapOnZRAM

Handling out of memory situations

The Linux OOM killer is not that great. There’s a growing amount of users who moved OOM handling to userspace:

Userspace OOM daemons:

Misc: