Subject: Getting rid of aggressive swapping
To: None <current-users@NetBSD.ORG>
From: Christian Biere <>
List: current-users
Date: 12/16/2003 01:27:08
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable


I always felt that NetBSD is too aggressiv WRT to swapping. 256 MB of RAM
should really be enough for my typical (desktop) usage. For example, if I u=
md5 after burning a CD my system would become close to unusable for
interactive usage. Especially Mozilla which is quite a memory hog (using
around 50 MB) after a little browsing becomes as responsive as dead meat. I
guess that's because most of it got swapped out and has to be swapped in.
Given that I have (practically) only one disk reading the pages from the sw=
partition is very slow because it's already busy with md5 and occasionally
used by other processes. E.g., it's so slow that "md5 /cdrw/*" completes
long before the md5 for the original files on the harddisk. [ The burner
and the harddisk don't share one cable/bus. ]
Actually, for my purposes I would seldom need swap space at all but when I
tried to disable it, the kernel started a killing spree and I couldn't
start most of my applications any longer while top showed still over
100 MB used for "File". AFAIK that's mostly cache as I always see it
increasing after using md5 with huge files. I don't quite understand
why cache would be more important than "normal" memory to run a

Therefore, I tried to "tune" the VM settings a little. Not saying that
I really understand these and their effect, I've settled with these

vm.anonmin =3D 50
vm.anonmax =3D 90
vm.execmin =3D 5
vm.execmax =3D 90
vm.filemin =3D 5
vm.filemax =3D 10

I've also noticed that changing them during runtime had hardly any
effect (if at all) but after a reboot I don't have the problems
with poor responsiveness any longer. ATM, absolutely no swap space
is used at all although I'm mildly stressing the system.

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.3 (NetBSD)