Skip to content

Instantly share code, notes, and snippets.

@evanphx
Created October 15, 2014 23:26
Show Gist options
  • Save evanphx/d912d77ba2ded4352ffc to your computer and use it in GitHub Desktop.
Save evanphx/d912d77ba2ded4352ffc to your computer and use it in GitHub Desktop.
Enable zram
modprobe zram num_devices=1
totalmem=`free | grep -e "^Mem:" | sed -e 's/^Mem: *//' -e 's/ *.*//'`
mem=$(((totalmem / 2) * 1024))
echo $mem > /sys/block/zram0/disksize
mkswap /dev/zram0
swapon -p 5 /dev/zram0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment