Turn Virtual Memory Swapping back on in Yosemite

I disabled virtual memory swapping using OnyX in Yosemite, but the program can't turn it back on when I click Turn On.

I already tried:

sudo launchctl load -wF /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist 

and it just says "Operation already in progress." OnyX still shows that the swap file is turned off and I have zero swap files. How do I turn it back on?


Solution 1:

Figured it out! I had to force the OS to create a swap file using this command in terminal:

memory_pressure -l critical

It will run a test to force your RAM usage to climb. Open Activity Monitor to watch its progress and it will show the swap file being created. Ctrl+C will stop the process in terminal. Now the virtual memory swapping works again.