Tiny Deathstars of Foulness

Every now and then I need to reclaim that space in /var/vm or I need to stop a process from paging to swap files while I’m troubleshooting something else. I in no way endorse disabling swap files (which basically kills using swap files as a part of your overall virtual memory) for extended periods of time. However, it has saved me in the case of stability concerns long enough to get a system patched or something like that. To disable OS X swap files, all you need to do is stop the daemon and restart. Use launchctl to stop: sudo launchctl unload -wF /System/Library/LaunchDaemons/ Once restarted, you may need to remove the files in /var/vm as that is where the swap files are stored. To do so, rm the contents of /var/vm: rm /var/vm/swapfile* You should also be able to get rid of the sleepimage file in that directory if needed. Since this is supposed to be a temporary or troubleshooting measure, to turn swapping back on: sudo launchctl load -wF /System/Library/LaunchDaemons/

January 21st, 2014

Posted In: Mac OS X, Mac OS X Server, Mac Security, Xsan

Tags: , , , , , , , ,