Interview Prep/Linux/Storage & Memory

What is swap, and what does `vm.swappiness` control?

IntermediateConceptStorage & Memory
Answer

Swap is disk space used to page out inactive anonymous memory (heap, stack) so RAM can be used for active data or cache. vm.swappiness (0–200, default 60) biases reclaim between swapping anonymous pages and dropping file cache; lower means prefer dropping cache.

swapon --show
sysctl vm.swappiness

Swap usage is not bad by itself; constant swap-in/out activity (si/so in vmstat) is.

All Linux questions Roadmap: Linux

More on Storage & Memory