Skip to content

Instantly share code, notes, and snippets.

@sr2ds
Created October 23, 2017 18:58
Show Gist options
  • Save sr2ds/a3f0a4e12eac33add3685cbb2dcb1066 to your computer and use it in GitHub Desktop.
Save sr2ds/a3f0a4e12eac33add3685cbb2dcb1066 to your computer and use it in GitHub Desktop.
Fast Swap Create
free -m
mkdir -p /var/_swap_
cd /var/_swap_
#Here, 1M * 2000 ~= 2GB of swap memory
dd if=/dev/zero of=swapfile bs=1M count=2000
mkswap swapfile
swapon swapfile
chmod 600 swapfile
echo "/var/_swap_/swapfile none swap sw 0 0" >> /etc/fstab
#cat /proc/meminfo
free -m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment