參考swp分區(qū)文章:https://cloud.tencent.com/developer/article/1936306
qiang@09230:~$ sudo swapon --show
NAME TYPE SIZE USED PRIO
/swap.img file 3.9G 1.8G -2
qiang@09230:~$ sudo fallocate -l 16G /swapfile
qiang@09230:~$ sudo chmod 600 /swapfile
qiang@09230:~$ sudo mkswap /swapfile
mkswap: /swapfile: warning: wiping old swap signature.
Setting up swapspace version 1, size = 16.1 GiB (17246973952 bytes)
no label, UUID=0c1c4153-370d-498f-9cb4-308456d1bdaa
qiang@09230:~$ sudo swapon /swapfile
qiang@09230:~$ sudo swapon --show
NAME TYPE SIZE USED PRIO
/swap.img file 3.9G 1.8G -2
/swapfile file 16.1G 0B -3
qiang@09230:~$ cat /proc/sys/vm/swappiness
60
qiang@09230:~$