设置虚拟内存参考:
https://blog.csdn.net/qq_38701476/article/details/83042668
最后在执行命令sudo swapoff swapfile时会提示swapon: /root/swap/swapfile: insecure permissions 0644, 0600 suggested. 其实不用管他,虚拟内存已经增加了使用命令查看: free -h
sudo swapoff swapfile
swapon: /root/swap/swapfile: insecure permissions 0644, 0600 suggested.
free -h