To read all comments associated with this story, please click here.
Because the cache is thrown away instantly when you need it for a process. It's as cheap to give a process cache memory as it is to give it free and unused memory (applications always expect garbage in newly allocated memory).
Cache is free, really. It means a small amount of CPU use to track the cache and a small amount of memory (which would shrink as you have less cache) and you gain faster disk accesses. It is win win, and I've never heard of a limit to its usefulness (beyond having more memory than disk space, but that's very unlikely).
This is part of why Unix systems improve their performance the longer they've been running.
I was, however, under the impression that XP already did this but didn't report on the cache use.
> Because the cache is thrown away instantly when you need
> it for a process.
I don't know about Vista, but I've seen linux start swapping instead of throwing away part of the 500+ MB it was using as cache. I tried adjusting swappiness and FS cache aggressiveness, but I couldn't make linux not lock up for short whiles (annoying e.g. when listening to music). In fact, I got so annoyed with these anti-desktop-oriented VMM algorithms (or whatever, I'm not a linux kernel expert) that I now have 3 GiB of RAM and no swap at all. Although there are still short lock-ups when some program suddenly starts using a lot of memory, they are at least an order of magnitude shorter than before.
Cache is free, really. [...] I've never heard of a limit to its usefulness
Until recently, you were 100% correct. But now we have ReadyBoost, a disk cache in flash memory, and this perilously close to destroying our theory that caching is always good.
Disks are moderately fast for sequential access and horrendously slow for random access. Modern DRAM is a couple orders of magnitude faster than a disk in sequential access and doesn't get much slower in random access, blowing the disk away by several orders of magnitude. The more you disk storage you can cache in DRAM, the better. Win-win, just as you said.
Flash memory, on the other hand, is not that much faster than a disk at sequential access. With a high-end disk, or an array of disks, it might actually be slower than the disk! So implementing a disk cache in flash memory is tricky. On some systems, you'll want to bypass the cache and go straight to disk if the request is sequential enough. On others, you don't get a significant performance improvement by reading sequential data from the cache. But for random access, the flash cache still blows the disk away. So you want to try to keep pages that are likely to be read randomly in the cache and evict pages that have been read sequentially to make room for pages that tend to be read more randomly.
Caching works under the assumption that higher-capacity devices will always be slower than smaller high-performance devices. But flash is so slow for its capacity, and disks are remarkably quick for their capacity at sequential reads, that it becomes a problem. There's just not enough of a performance delta between flash memory and disks in many situations.







Member since:
2005-06-29
Soo... suppose I have 16Gb of memory. Will Vista eat all of it (just for itself)? If yes, why is it good, I believe there's a natural limit on what to fill that cache with!
Edited 2007-02-28 19:58