Subject: RE: memory allocation question
To: None <port-hpcmips@netbsd.org>
From: Tim Underwood <TimU@hightouchinc.com>
List: port-hpcmips
Date: 08/11/2004 13:45:38
=20

> -----Original Message-----
> From: port-hpcmips-owner@NetBSD.org=20
> [mailto:port-hpcmips-owner@NetBSD.org] On Behalf Of Noriyuki Soda
> Sent: Wednesday, August 11, 2004 12:10 PM
> To: Tim Underwood
> Cc: port-hpcmips@netbsd.org
> Subject: Re: memory allocation question
>=20
> >>>>> On Wed, 11 Aug 2004 11:41:22 -0500,
> 	"Tim Underwood" <TimU@hightouchinc.com> said:
>=20
> > When in text mode, I run "top", and a line is displayed that shows:
>=20
> > Memory: 11M Act, 132K Wired, 3012K Exec, 6676K File, 13M Free
> > Swap: 257M Total, 257M Free
>=20
> > Not sure what "Wired" means.
>=20
> "Wired" is memory region which is locked on physical memory.
>=20
> > 1.  How can I reduce the approx 6MB memory given over to=20
> disk cache? =20
> > In Linux, I just echo a value out to the /proc subsystem, and it=20
> > happens dynamically.  Is NetBSD like the "old" unices,=20
> where I have to=20
> > set a value and recompile the kernel?  Or is there a dynamic way of=20
> > setting this?
>=20
> You can tweak the file cache usage dynamically by setting=20
> sysctl variables. I recommend the following values for=20
> systems which only have 32MB memory, and for interactive use.
> 	$ sysctl -w vm.filemin=3D2
> 	$ sysctl -w vm.filemax=3D4
> (default value is vm.filemin=3D10 and vm.filemax=3D50) You can=20
> use /etc/sysctl.conf to set these values at boot time.
>=20
> But this setting affects only when free memory isn't enough.
> File cache grows as far as there is enough free memory.
> If memory shortage happens, and if Exec pages or Anon page=20
> need more memory, File pages will be reclaimed and the pages=20
> will be used for Exec pages or Anon pages.

So, if I understand you correctly, memory will always be reclaimed from
the file cache, as needed?  No matter what the min/max settings are?
And will that memory always be reclaimed prior to using swap?

I'll double check - but that isn't what I'm experiencing.  I go into
swap almost immediately with X (not much, about 200K), but I still have
lots of file cache memory left.  I'll compare this before/during
Xwindows to see what's happening.