S
S
s0lar2014-12-01 16:39:45
Swap
s0lar, 2014-12-01 16:39:45

How to disable swap on Mac os Yosemite?

Hello. On Mac os Yosemite, I can't disable the paging file. On the last OS, the issue was resolved very quickly: I googled it, ran the command in the terminal and you're done. But on Yosemite, the old method doesn't work.
After making changes, the swap file remains.
I found only this solution
apple.stackexchange.com/questions/152305/disable-s...
but I don't understand how to run this script.
Who succeeded?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
asd111, 2014-12-01
@asd111

It looks like a shell script. Try to create a file with extension .sh like swap.sh and add it there

# 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

then open a terminal where the script is located and run the script like this: /bin/sh swap.sh

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question