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:
- Systemd Will Be Working To Improve Out-Of-Memory Linux Handling With Facebook OOMD
- Fedora Workstation 32: Enable earlyoom by default
- Fedora Workstation 34: Replace earlyoom with systemd-oomd
- lwn.net: OOM killer and cgroups. Better do it in user-space?
- https://lkml.org/lkml/2019/8/4/15
- In defence of swap: common misconceptions
Userspace OOM daemons:
Misc: