Subject: Re: Swap used for no reason?
To: David Laight <david@l8s.co.uk>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-help
Date: 01/09/2006 13:31:23
On Sun, 8 Jan 2006, David Laight wrote:

> > 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?
> 
> Why do you care?  As soon as the programs that use those pages try
> to access them, they will we read into memory.  Since that hasn't
> happenned already, it may well not happen at all!

I cared because I didn't think my swap should have been used in the first 
place.

And now I see that I have 38MB of swap used although my "buffers" is 
around 137MB (37MB cached executable pages and 99MB cached file pages) and 
I have 1MB free real memory.

(A few minutes ago, I had 8MB free real memory and still 137MB buffers and 
38MB used but my cached executable pages was around 30MB.)

But if I understand Chuck's reply, some software is written to encourage 
the swapping.

Are there any benchmarks for this? When is it better to use hard disk for 
swapping memory versus using real memory for caching hard disk?

 Jeremy C. Reed

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