I have a huge Mercurial repository (take a guess how many directories it has -- it's gonna be more than you guessed). The time taken to do basic repository operations is heavily dependent on whether the system buffer cache is hot or cold, as the following example demonstrates (one command run right after the other):
bash> time hg status real 0m41.809s user 0m0.815s sys 0m0.217s bash> time hg status real 0m0.858s user 0m0.679s sys 0m0.175s
After I don't use the machine for a few days (without rebooting), I find the cache has gone cold, and it takes a long time again to run
hg status. This is despite none or few of the directories having changed (verified by checking mtimes) and having a gigantic amount of RAM (which even counting the page cache isn't all used; verified with
So given that there is no memory pressure, why are things getting evicted from the dentry or inode caches? Do they have some max size somewhere? Anecdotally, I've never seen the "buffers" column in
free go much above 4 GB. Not sure if the system is refusing to let the buffer cache grow bigger than this.