树莓派的swap大小在/etc/dphys-swapfile中定义,默认为100M

[email protected]:~$ cat /etc/dphys-swapfile 
CONF_SWAPSIZE=1000
[email protected]:/mnt$ free -h
         total       used       free     shared    buffers     cached
Mem:          437M        36M       401M         0B       2.1M        12M
-/+ buffers/cache:        22M       415M
Swap:          99M         0B        99M
[email protected]:/mnt$ 

可以自己修改CONF_SWAPSIZE的值,单位为兆(MB)

修改后重启树莓派生效,如下:

[email protected]:~$ cat /etc/dphys-swapfile 
CONF_SWAPSIZE=1000
[email protected]:~$ free -h
             total       used       free     shared    buffers     cached
Mem:          437M        53M       383M         0B       7.9M        23M
-/+ buffers/cache:        22M       415M
Swap:         999M         0B       999M