Mac OS Disk Cache - A Piece Of Crap
Some times ago, I noticed that doing a lot of IO operation on encrypted loopback partition (like FileVault disk images) was trashing my system memory : after a while, the system began to swap a lot. I first thought some app was allocating huge parts of memory, but that was not the case. At this time I suspected some memory leaks in the encryption or the disk image code of the Mac OS kernel. So I tried to do a lot of IO on a regular HFS partition. The same issue was present, but the swap usage was increasing slowier this time. The only solution I found to avoid this, was not to use disk intensive applications. Unfortunetaly, as now use my mac to process RAW picture using Adobe Lightroom and this is a disk intensive application, so I bought 1 Go of memory to double the amount of RAM available for Mac OS. I was hopping this would definitevely solve my swap issue. This was not the case, when I process a bunch of RAW file in a short amount of time, the system cannot refrain itself from swapping. Lightroom only eat 800M of memory, and while no other application if running. This only happen while using intensive disk IO operation (eg: processing RAW files or compiling many java files) and after the application is shut down the amount of physical memory used by the system is really high, so I come to conclusion that the IO cache of the kernel is just a piece of crap, eating a lot of memory without trying to figure out if there is enough memory to cache something : swapping memory pages holding disk cache is just stupid. Is someone else is experiencing same issues, please let me know !
Comments (2)
:: Trackback (1)
Comments
Display comments as
(Linear | Threaded)
Interresting reads :
http://forums.macosxhints.com/showthread.php?t=9047 http://forums.macosxhints.com/showpost.php?p=302465&postcount=9 The issue is not new : it is present since the first release of Mac OS X ! The memory management of that system really sucks !
This first link is quite useless since the guys don't know a thing about modern memory management. Not that OS X accounting of disk cache as used memory is helpful in this regard but hey, who said these numbers really should mean anything to an untrained eye.
As of the VM (virtual memory) subsystem: It's as good as it gets. At least as good as on Linux and probably better than on Windows. Swapping unused memory to disk to free up some for disk cache may be a good thing. Some apps allocate more memory than they really need at the moment and swapping some of it out may be a good idea. |
QuicksearchCategoriesSyndicate This Blog |
Powered by s9y
