NJRonbo asks:
"What is the terminal command to disable swap?"
To DISABLE virtual memory:
sudo launchctl unload -wF /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist
(reboot necessary afterwards)
To REMOVE swap files:
sudo rm /private/var/vm/swapfile*
To check if VM is being used:
sysctl vm.swapusage
If VM is off, report should be:
vm.swapusage: total = 0.00M used = 0.00M free = 0.00M
Note:
All I've ever done is to DISABLE VM disk swapping.
I have NEVER turned it back on again, not sure if this is the right command, but here it is:
To enable swap, you need to boot in Single User Mode (Hold [CMD + S] at booting time) and run this command:
sudo launchctl load /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist
Fishrrman's note:
These are from my archives.
Not sure if the "remove swap file" still works on latest OS's.
But the other commands do.