Created
October 15, 2014 23:26
-
-
Save evanphx/d912d77ba2ded4352ffc to your computer and use it in GitHub Desktop.
Enable zram
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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