Subject: Re: Limiting memory usage of bufcache?
To: Matthias Buelow , Curt Sampson <>
From: Jukka Marin <>
List: netbsd-users
Date: 08/24/2001 07:53:41
On Fri, Aug 24, 2001 at 02:48:24AM +0200, Matthias Buelow wrote:
> >Well, the problem I'd like to fix somehow is that all my processes get
> >paged out of RAM when I do lots of disk I/O.  After a nightly backup,
> Urrrggh.  That sounds similarly broken like the WindowsNT behaviour we
> have observed in an earlier version (dunno if it's still doing it) of
> writing out its filecache pages to the swapfile.  If NetBSD is actually
> paging out active pages to make room for the buffer cache, this is a
> horribly serious bug and should be fixed ASAP!

Well, after creating a CD image, 98% of my processes had the resident size
of 4 kB according to ps.  (Many still do.)

> The buffer cache must
> always have a lower priority than user-space mapped pages and only use
> completely unmapped memory pages which are unused otherwise (it shouldn't
> even harrass the "inactive" pages of recently mapped but now unmapped
> user pages.)

It wouldn't work that way, either.  Although I have 384 MB of physical RAM,
my system may still not have any unused RAM, so the buffer cache would get
no RAM at all.

On Fri, Aug 24, 2001 at 12:01:03PM +0900, Curt Sampson wrote:
> > Simply creating a cd image flushes all processes out of RAM and makes a nice
> > machine dead slow.  It makes no sense to try caching all the cd image data
> > in RAM, anyway, because it is only accessed once and then deleted ;)
> Solaris deals with this by detecting that a file is being used purely
> sequentially, and changing the way it decides what to discard when
> new memory is needed.

I guess this would help.. but setting a simple limit to buffer cache memory
usage would be very simple (right?) and it would keep the cache from flushing
all processes out of RAM.

I just hate it when it takes 10 or 15 seconds to switch to another desktop
because all xterms, editors etc. have been paged out...  10 or 15 seconds
on a 900 MHz machine with 384 MB of RAM :-(

Isn't anyone else suffering from this?  Am I the only user with less than
256 GB RAM?