[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Examining Swap



On Thu, Nov 03, 2005 at 01:54:45PM -0800, Tony Godshall wrote:
> According to Thomas,
> > Hello there.
> > 
> > 
> > My debian server uses max 50% of its 1 GB ram while im looking at it, 
> > also under stress conditions. Still, if it is running for a few days, 
> > there are about 100 MB swapspace used.
> > 
> > I dont know what is written into the swapfile.
> > Now i ask myself, how i can find out whats inside of the swapfile, and 
> > most important, why.
> > 
> > Is there a way to examine that?
> > Is there a way to move the contents of the swapfile back into the (free) 
> > mem manually?
> 
> Sounds to me you have a memory leak.

No, it doesn't.  The memory manager swaps data/program that hasn't been used
recently out to disk, even if memory isn't near full.  It does NOT mark the
copy of the data in RAM as unused, or recycle those memory addresses.  That
way, if a huge memory request comes in, the memory manager can carry out the
very fast operation of marking all that RAM as ready for use, and it's
"pre-swapped".  If you need the swapped thing again, no time is lost (since
a copy is still in RAM).
-- 
Carl Fink                                         carl@fink.to
If you attempt to fix something that isn't broken, it will be.
	-Bruce Tognazzini



Reply to: