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.
More on Storage & Memory
How do you list disks, partitions and filesystems?IntermediateMBR vs GPT partition tables?IntermediateWalk through adding a new disk and mounting it permanently.IntermediateExplain the six fields of an /etc/fstab line.IntermediateWhy use UUIDs and `nofail` in fstab?IntermediateWhat does a bad fstab entry do, and how do you recover?Advanced