On 1-May-08, at 12:10 PM, Jonathan Schleifer wrote:
Isn't there an option to tell NetBSD to stop that stupidity and free the file cache when applications need it far more badly? I don't want files cached that aren't used so often anyway. In this case, a 200 MB file was cached that was only used once. That doesn't make any sense.
Well if you can figure out how to get the machine to read your mind and intuit your future needs, then maybe you'll have your wish granted! :-)
In the mean time the system is just doing the best it can given the information it has and the configuration you've given it.
You might consider dropping the file cache percentage significantly (sysctl vm.filecache), but then you'd risk punishing every instance where cached data could have been used just to foil the occasional case where the system mistakenly caches a large file which only you in your head know will never be accessed again.
One hunch I have though is that the file cache is not as quickly cleaned of pages from unlinked files (which also have no open descriptor references) as it maybe could be. Perhaps if the VM could be given a hint about unlinked and un-referenced files then their pages could more quickly be freed. I may be mistaken though -- perhaps this already happens and I've just been confused by some other issue.
BTW, disabling swap won't necessarily have the best effect either -- you may then be artificially creating pressure on the VM to keep rarely used pages in active RAM which may then have unintended consequences.
-- Greg A. Woods; Planix, Inc. <woods%planix.ca@localhost>