grep -rl "memory" ./blog

Linux Memory Management

RAM, swap, caching, and why the amount of free memory Linux reports is almost never what people expect.

8 articles

zswap vs zram: Which Compressed Swap Should You Use? Both compress memory to stretch your RAM, but zram is a swap device in RAM while zswap is a compressed cache in front of disk swap. How each works, how to check and configure them, why you should not stack them, and which to pick. Memory Pressure, PSI and the OOM Killer: Deciding What Dies The kernel OOM killer picks by score and the score is mostly size, which is why it takes your desktop shell instead of the browser. How to read pressure stall information, set OOM scores that reflect importance, and why systemd-oomd and the kernel disagree. Hugepages and NUMA Explained How TLB misses cost performance, the difference between transparent and explicit hugepages, why databases disable THP, and reading NUMA topology properly. The OOM Killer Explained: Why Linux Killed Your Process How memory overcommit leads to the OOM killer, how it picks a victim, how to read the kernel log entry, and how to stop it choosing the wrong process. zram and Swap Tuning: Compressed Memory Instead of Disk zram gives you swap that lives in RAM, compressed. On machines with limited memory it is dramatically faster than swapping to disk, and most distributions now enable it by default. Swap Space Explained What swap actually does on Linux, how it differs from RAM, how to create a swap partition or swapfile, and how to tune swappiness for desktops, laptops, and servers. The free Command Explained free is the fastest way to check RAM and swap usage on Linux. This guide covers every column in its output, why "available" matters more than "free", and how to read swap usage correctly. Monitoring Memory Usage on Linux A practical guide to checking memory usage on Linux: reading /proc/meminfo, understanding what counts as "used" memory, finding which process is consuming RAM, and recognizing real memory pressure versus normal cache behavior.