How would I prevent OS X even looking for a swap file?
I killed the swap file on my MBP. This is dead easy: just change the default swap file location so the system can't find it (goto /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist, change the last <string> in the ProgramArguments section.)
This achieves what I wanted it to achieve. My swap file is always 0mb and hence I can leave my mac on for weeks without the crippling swap-induced slowdown I came to loathe.
The question is, how can I stop the system looking for the swap file? The swap is never created because the path specified in the .plist file doesn't exist. But the system still looks for it, meaning a background process every 10 seconds, which looks like this:
dynamic_pager: cannot open swap directory /your/fake/directory/here
(com.apple.dynamic_pager[123]) Exited with exit code: 1
(com.apple.dynamic_pager) Throttling respawn: Will restart in 10 seconds
I want to stop this from happening, so my machine isn't constantly seeking something that isn't there, and to placate my innate OCD nature (as far as I can tell, this isn't using any real footprint).
Does anyone know how?!
malloc()could ever fail. Also, without a pager, I don't think memory-mapped file I/O would work. – Spiff Mar 25 '11 at 4:46