Subject: Swap used for no reason?
To: None <netbsd-help@NetBSD.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-help
Date: 01/07/2006 16:41:47
Today, I added 160 MB to my desktop system that has been running with 
128MB for at least five years.

I just noticed that top showed:

Memory: 80M Act, 72M Inact, 772K Wired, 20M Exec, 107M File, 65M Free
Swap: 193M Total, 16M Used, 176M Free

And free (from pkgsrc) showed:

             total       used       free    buffers
Mem:        282268     216444      65824     129980
Swap:       197564      16872     180692


Why would swap be used? I did use some xml/docbook earlier that used a lot 
of memory (and I didn't watch to see how much), but why is the swap still 
being used?

Is there timeout of when the swap won't be used anymore (and real memory 
will be used again instead)?

Or do I have to wait until that area in swap is used again, so the kernel 
will know to use the physical memory instead?

Maybe I found answer for above question at teh "Tuning NetBSD VM 
behaviour" webpage which says "When the paged out pages are needed, and 
there is room in RAM for them, they will be paged back in."

Is there anyway to make this happen manually? How can I know what 
processes are involved? (I tried to use all my X clients that I had 
running to see if any would change this.)

This is NetBSD/i386 2.0.2.

I followed various ideas and a webpage for sysctls for tuning virtual 
memory several times, but never got my old 128MB system to behave better. 
I asked about this before.

How do you stop swap from being used (other than not having swap)?

Thanks,

 Jeremy C. Reed

 	  	 	 BSD News, BSD tutorials, BSD links
	  	 	 http://www.bsdnewsletter.com/