ram and swap memory question

Kerry Hoath kerry at gotss.net
Mon Nov 11 23:02:34 EST 2002


The virtual memory subsystem is more complicated than this.
If a process sleeps for a long time (example an unused getty on a console)
it's pages are candidate for swapping out.
Also daemons that are not in use for example nfsd or portmap etc can also be swapped out.
Once pages are swapped out they are not swapped back in until needed.
Say you ru n  a large process and it swapps out 20 megs; ifthe
processes that are swapped out stay asleep they are not swapped back in until needed.
A lot of  your ram is also used as buffer cache; it is reclaimed when needed by running processes.
Are you ru nning squid on t his box  by chance?
remember squid uses 3 times the cache_meg setting.
Also  note; a process once it mallocs remory and dirties th e  pages the memory
is not freed until the process terminates.

Regards, Kerry.
On Sun, Nov 10, 2002 at 09:28:32PM -0600, Gregory Nowak wrote:
> Hi All.
> 
> Below is a portion of output from top(1), which will explain my following question.
> 
> 
> 70 processes: 68 sleeping, 2 running, 0 zombie, 0 stopped
> CPU states: 20.0% user, 80.0% system,  0.0% nice,  0.0% idle
> Mem:   256268K av,  196460K used,   59808K free,       0K shrd,    9112K buff
> Swap:  377436K av,    8452K used,  368984K free                   80376K cached
>  
> 
> If I have 59 megs of ram free, then could someone please explain why 8 megs of swap are being used? I thought the system didn't start using swap until it ran out of ram.
> 
> Thanks in advance.
> 
> Greg
> 
> 
> _______________________________________________
> Speakup mailing list
> Speakup at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
> 
> 

-- 
Kerry Hoath:  kerry at gotss.net kerry at gotss.eu.org or  kerry at gotss.spice.net.au
ICQ: 8226547 msn: kerry at gotss.net Yahoo: kerryhoath at yahoo.com.au





More information about the Speakup mailing list