edit "/etc/dphys-swapfile"
CONF_SWAPSIZE=2048 #swap file size (MB)
CONF_MAXSWAP=4096 # max swap file size
exec "sudo service dphys-swapfile restart"
exec "free" to verify.
===========================================
使用zram
"sudo apt install zram-tools"
edit "/etc/default/zramswap"
PERCENTAGE=50
exec "sudo service zramswap restart"
exec "free" to verify
exec "swapon" to check