Skip to content

Instantly share code, notes, and snippets.

@yangwe1
Created October 10, 2015 07:04
Show Gist options
  • Save yangwe1/02651b4112cdb91e17bb to your computer and use it in GitHub Desktop.
Save yangwe1/02651b4112cdb91e17bb to your computer and use it in GitHub Desktop.
add a swap file temporarily
sudo dd if=/dev/zero of=/swapfile bs=1024 count=524288
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

在VPS上执行完耗内存程序再关闭

sudo swapoff /swapfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment