备份 /etc/fstab
cp /etc/fstab /tmp/fstab.`date +%F`
删除 /etc/fstab 中 swap 挂载项
vim /etc/fstab
删除带swap的行
关闭所有 swap
swapoff -a
观察进程使用 swap 和 swapoff -a 之后回收情况,对于不能回收 swap 的进程需要安排时间重启
检查:
free -m # 应该 Swap 这一行显示全是
0
cp /etc/fstab /tmp/fstab.`date +%F`
删除 /etc/fstab 中 swap 挂载项
vim /etc/fstab
删除带swap的行
swapoff -a
观察进程使用 swap 和 swapoff -a 之后回收情况,对于不能回收 swap 的进程需要安排时间重启
free -m # 应该 Swap 这一行显示全是
0