David,
I had watched my swap and didn't see any page outs for a good duration of time. The swap-file may be created, but look (via the Activity Monitor application) at how many page outs you're dealing with.
As for looking at the source code for the pager daemon (dynamic_pager), the source code to Darwin is available. Check out the daemon itself at http://www.opensource.apple.com/source/system_cmds/system_cmds-433/dynamic_pager .tproj/dynamic_pager.c. This is the front-end / daemonizing interface of the dynamic_pager of course and a lot of the action is handled by the kernel it seems. Of course, in all honesty, nobody is going to be analyzing this (and the system calls it makes to interface with Mach and the Darwin BSD memory subsystem) in detail as a result of this 😀. unless, of course, this is where the problem lies.. then Apple, get off your duff and do it!
I disable swap because of security reasons -- even though it may be encrypted, it can obviously be read while the system is on and the interface for accessing it is able to read the data. I think on OS X it has been encrypted by default for a while now, and the option has been there for quite a few versions. In that dynamic_pager.c source code you can see an argument to paging_setup() called encrypted, a boolean, that if true encrypts the swap. A lot of applications have data that should not be swapped out. But I don't trust it when the system is on.
And, if it is paging out when not needed as you claimed, then it does indeed impact performance and life-span with an SSD as you mentioned , since there is a maximum number of write cycles per "sector" or whatever they call the individual units of memory in the SSD.
I don't think the pager is responsible for the hibernation; hibernation does indeed write out the contents of memory to disk and fetches it on reboot to present the user with the exact same state it was in when it hibernated, but this is handled differently than swapping out pages to memory as part of a VM.
Regardless, if this were truly causing the issue, then there is some serious underlying bug with OS X's memory manager, and other things would be seriously corrupted rather than solely the icon sets.
I will however try enabling swap. Did you see it corrected immediately after wards and rebooting, or did you have to also do the safe boot or user delete dance in order to restore the icons?
BTW What kind of OS are you developing? I am a student of Andrew Tanenbaum's MINIX operating system and his book for it, "Operating Systems Design & Implementation 3rd Edition" which is an awesome teaching tool, and of course years of experience with UNIX-like OSes and with writing BSD and Linux kernel modules. Always a pain in the arse but good fun.
Thanks,
Brandon