What is swap memory in linux? What It Really Is, Why It Exists, and How to Actually Use It
Briefly

What is swap memory in linux? What It Really Is, Why It Exists, and How to Actually Use It
"You probably have heard people say things like "Enable swap if your system is crashing" or "Swap makes your machine slow" or "Enable swap if app is dying with OOM" So in this article, let's talk about swap memory, what it is, how to enable it, how to check if it's running, how it's different from virtual memory, and when it helps vs. when it hurts."
"What Is Swap Memory? Swap is simply a portion of your disk (HDD/SSD/NVMe) used as a slower backup for RAM. When your RAM fills up, the Linux kernel quietly moves "cold" data( i.e. rarely used memory pages) into swap, freeing up RAM for things we are actively running. Swap doesn't replace RAM. It extends it. Swap is one of the actual physical places Linux can store memory when RAM is full or when certain pages aren't being used actively."
Swap is a portion of disk storage used as a slower backup for system RAM. When RAM fills, the kernel moves rarely used "cold" pages into swap to free RAM for active processes. Swap extends available memory but does not replace RAM; accessing swap is far slower than RAM. Swap can prevent immediate out-of-memory (OOM) kills by providing extra backing storage during spikes, but heavy swapping degrades performance. Swap and virtual memory are different: swap is a physical backing store while virtual memory is the abstraction for address mapping. Enable swap for occasional spikes; avoid heavy swapping on performance-critical systems.
Read at Medium
Unable to calculate read time
[
|
]