使用命令
swapoff -a
重新开启的话使用命令
swapon -a
查看内存和swap分区使用情况
[root@192 ~]# free -m
total used free shared buff/cache available
Mem: 3771 253 3178 9 339 3226
Swap: 3967
想永久生效把 vim /etc/fstab
注释 swap
那一行
#
# /etc/fstab
# Created by anaconda on Sun Apr 28 16:03:29 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root / xfs defaults 0 0
UUID=2b6533dc-046d-49c4-8acf-d56ada2dfdad /boot xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill
标 题:centos关闭swap