什么是swap空间?

这篇文章很好地解释了什么是swap

Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. While swap space can help machines with a small amount of RAM, it should not be considered a replacement for more RAM. Swap space is located on hard drives, which have a slower access time than physical memory.

Swap空间存在于硬盘上,它的作用是当内存空间满了后,可以把当前内存中访问不是很频繁的页面放到swap上。