Subject: Re: reading output from 'top' [1.6.2 / i386]
To: None <netbsd-help@netbsd.org>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-help
Date: 01/16/2005 16:10:39
In article <7b96990305011607377fd6ca4b@mail.gmail.com>,
	Mark Thomas <thomas.s.mark@gmail.com> writes:
> On Sun, 16 Jan 2005 15:12:24 +0000 (UTC), Frederick Bruckman
> <fredb@immanent.net> wrote:
>> Oh, I know that one.  It's the amount used by the Universal Buffer Cache,
>> i.e. the file cache.  When you write a file "to disk", it's still in the
>> file cache for a while, so you can read it back quickly without actually
>> touching the disk. It's called "universal" because there used to be many
>> caches for individual file systems and other things, but now they can all
>> share. It's also a "buffer", so that the driver can re-order writes.
> 
> Is there a way flush the "Universal Buffer Cache" or do I need to?
> When I transfer many files at once, say using 'scp' the cache goes
> _way_ up and stays there for a long time.

Indeed it does. If it didn't, the memory would be mostly
wasted.  It'll be paged out when needed, or as time goes by.
The "sync" command will write it all out to disk at once, though
not necesarily purge it from the cache. You might want to do that
before trying something that may crash. There is a way to tweak
the cache usage, "sysctl vm", but mainly it sounds like it's
working the way it's supposed to.


Frederick