0%

change swap size in linux

内存太小了,只能用swap来顶替了。。

几条命令就好了

1
2
3
4
5
6
7
8
9
10
11
12
13
$ sudo swapoff -a

$ sudo dd if=/dev/zero of=/swapfile bs=1G count=8
if = input file
of = output file
bs = block size
count = multiplier of blocks

$ sudo mkswap /swapfile

$ sudo swapon /swapfile

$ grep SwapTotal /proc/meminfo