Skip to content

Instantly share code, notes, and snippets.

@almokhtarbr
Created September 15, 2019 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almokhtarbr/cb2512eeb1aa75a48730b8cca69c0fc4 to your computer and use it in GitHub Desktop.
Save almokhtarbr/cb2512eeb1aa75a48730b8cca69c0fc4 to your computer and use it in GitHub Desktop.
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