add swap file if you only have 1G RAM

dd if=/dev/zero of=/swapfile1 bs=1024 count=524288

mkswap /swapfile1

swapon /swapfile1

vi /etc/fstab

# edit /etc/fstab file, add the following line

/swapfile1 none swap sw 0 0

# save and quit

free -m

swapon -s
原文地址:https://www.cnblogs.com/otfsenter/p/9626924.html