Subject: Re: large files seem to fill up ram
To: David Wetzel <dave@turbocat.de>
From: Harry Waddell <waddell@caravan.com>
List: netbsd-help
Date: 12/11/2002 16:06:23
On Thu, 12 Dec 2002 00:25:40 +0100
David Wetzel <dave@turbocat.de> wrote:

> Manuel Bouyer wrote:
> 
> > This is normal. As long as there is free ram, it will be used as cache.
> > This space should be reclaimed as soon as something else needs the RAM.
> 
> why is the swap used here: ?
> 
> CPU states:  0.5% user,  0.0% nice,  0.0% system,  0.0% interrupt, 99.5%
> idle Memory: 221M Act, 113M Inact, 236K Wired, 9460K Exec, 288M File, 6480K
> Free Swap: 499M Total, 51M Used, 449M Free
> 
> It should be faster to use RAM for memory than to waste it as cache und use
> swap as mem?!

On the whole the default behaviour of using memory pages as an io write cache
pays off. The archives for current-user and tech-kernel should contain lots of
verbage about the design and why it was chosen. Certain common activities like
rebuilding userland have been shown to benefit from this use of buffer cache.

For those that don't want their systems to bahave that way, sysctl can be used
to modify vm.filemin and vm.filemin at run-time. I believe there are some VM
related options that you may add to your kernel config as well. See options(4)
for more details.

-- 
Harry Waddell
Caravan Electronic Publishing