Linux swap 使用

使用的背景

内存吃紧的时候可以考虑使用swap.

swap新增

http://www.cnblogs.com/wuxie1989/p/5888595.html

swap 使用

https://www.cnblogs.com/PandoraX/p/6806364.html

创建分区

查看使用百分比

 

释放分区

--关闭swap 交换分区:

[root@dave ~]# swapoff  /dev/sda2(swapfile的路径)

[root@dave ~]# swapon -s

Filename                                Type            Size    Used   Priority

--查看swap的使用情况:

[root@dave ~]# free -m

            total       used       free    shared    buffers     cached

Mem:         1954       1939         15          0         21       1343

-/+ buffers/cache:        573       1381

Swap:           0          0          0

--启用swap分区:

[root@dave ~]# swapon /dev/sda2

原文地址:https://www.cnblogs.com/eason-d/p/9328464.html