Created
April 16, 2015 02:12
-
-
Save junxy/545a1c42880c4f493359 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Check installed RAM, disable VM if 8Gb or more. | |
mem_inst=`/usr/sbin/sysctl -n hw.memsize` | |
if [ "$mem_inst" -ge "8589934592" ]; then | |
echo "8Gb+ Memory installed." | |
if [ "$action" == "unload" ]; then | |
sudo nvram boot-args="vm_compressor=2" | |
sudo pmset -a hibernatemode 0 | |
echo "vm.compressor_mode set to 2" | |
else | |
sudo nvram boot-args="vm_compressor=4" | |
sudo pmset -a hibernatemode 3 | |
echo "vm.compressor_mode reset to defaults" | |
fi | |
launch_control $action /System/Library/LaunchDaemons com.apple.dynamic_pager | |
else | |
echo "Less than 8Gb memory." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment