swapoff(常见于 Linux/Unix):关闭交换分区或交换文件(swap)的命令;会停止系统对指定 swap 设备/文件的使用,并将其中的数据尽可能迁回内存(RAM)。在内存不足时可能导致性能下降或触发 OOM(内存不足)问题。
/ˈswɒpˌɒf/
Swapoff the swap file before you delete it.
在删除交换文件之前,先用 swapoff 把它停用。
After diagnosing heavy disk thrashing, the admin ran swapoff -a and then re-enabled swap with swapon to reset the system’s swap usage without rebooting.
在排查到严重的磁盘频繁换页后,管理员执行了 swapoff -a,随后用 swapon 重新启用 swap,以便在不重启的情况下重置系统的交换使用状态。
该词由 swap(交换空间/换页)+ off(关闭)构成,是典型的类 Unix 命令命名方式:用简短的英语词组合直观表达功能,与 swapon(开启 swap)成对出现。
swapoff(8) 手册页,通常在 util-linux / man-pages 项目中发布)