Linux uses virtual memory to give each process the illusion of having its own address space.
Key concepts:
- Virtual memory: Abstraction over physical RAM.
- Pages: Memory divided into fixed-size blocks (typically KB)
- Page fault: Accessing memory not currently in RAM triggers loading from disk
- Swap: Disk space used when RAM is full
OOM Killer: When memory is exhausted, the kernel kills processes. It scores processes by memory usage and other factors.
Commands: free -m, vmstat, /proc/meminfo
Interview question: "A server is slow and swapping heavily. How do you diagnose?"