3 ms·
The core reason that this happens is that OS X uses a memory management mechanism called Unified Buffer Cache (http://kerneltrap.org/node/315 http://kerneltrap.
by xpaulbettsx 14y ago
The core reason that this happens is that OS X uses a memory management mechanism called Unified Buffer Cache (http://kerneltrap.org/node/315 http://kerneltrap.org/node/315 is the only reference I can find on this).
This seems like a good idea to unify paging and disk cache memory, but it actually isn't. This means, that if you do a lot of I/O, resident pages (i.e. your programs) can actually get pushed out of memory to free up RAM for the disk cache. This degenerates pretty badly in scenarios like using VMs, since you're also using large sections of mmap'd memory.
This doesn't happen on NT or Linux, because disk cache can only be turned into memory (i.e. making disk cache smaller), not the other way around; the policy is "Disk cache gets whatever's left over, Memory Manager has priority"
Unfortunately, the only thing you can really do about it, is have a machine with a huge amount of RAM, which will kind of help.
- zurn 14y ago> This doesn't happen on NT or Linux, No, NT and Linux also have unified VM. What BSD had pre-UVM was pretty antiquated.