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
"If you've used Linux long enough, chances are you've bumped into the term . 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. By the end of this, you'll know exactly how swap works and whether you should enable it in your production servers."
"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. RAM = fast working space Swap = slower storage space for unused or idle data"
Swap reserves disk space to act as a slower backup for physical RAM. The kernel moves rarely used or idle memory pages to swap when RAM fills, freeing RAM for active tasks. Swap extends available memory capacity but cannot replace the speed of RAM. Swap serves as a physical location for memory pages when RAM is full or pages are inactive. Use of swap can prevent out-of-memory failures, but moving pages to disk increases latency and can degrade performance. Swap and virtual memory are distinct concepts, and swap should be evaluated per workload for production use.
Read at Medium
Unable to calculate read time
[
|
]