4 ms·
I have 8 GB RAM. Why doesn't the kernel load everything to memory the first time I use it, and have it available afterwards? Shouldn't the fs cache do that anyw
by StavrosK 14y ago
I have 8 GB RAM. Why doesn't the kernel load everything to memory the first time I use it, and have it available afterwards? Shouldn't the fs cache do that anyway?
- jewel 14y agoIf by kernel you mean linux, then yes, it does do precisely that. Try this out on a large file: time cat bigfile > /dev/null time cat bigfire > /dev/null Then wait a few minutes and try again. Linux won't evict the pages from the cache unless something else wants to use the space.
- stcredzero 14y agoOS X does that. A problem: it's currently set up so that 8GB is not quite enough. It would be better for it to be just a bit less agressive in caching and have much lower "swappiness." Right now, it's as though it's set up to be responsive to a wide variety causal use-cases, but far from optimal for users doing really memory intensive work on just a few apps.