ram and swap memory question

Aaron Howell aaron at kitten.net.au
Sun Nov 10 22:38:30 EST 2002


Greg,
Its an efficiency thing.
Programs which have been inactive for a very long time (such as getty processes on terminals not being used, or gdm waiting for an X login) get pushed out into swap.
If there was a sudden spike in memory usage, this would have to happen anyway.
but Linux does it preemptively so that less time is taken when the ram is needed.
If the processes suddenly need to become active, e.g if someone goes to log into a getty that has previously been idle, then Linux will swap the proces back in.
Regards
Aaron
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

-- 
     +----------------------------------------------------------+
    /             |\      _,,,---,,_                           /|
   /              /,`.-'`'    -.  ;-;;,_                      / |
  /              |,4-  ) )-,_. ,\ (  `'-'                    /  |
 /             '---''(_/--'  `-'\_)                         /   |
+----------------------------------------------------------+    |
| Aaron Howell                  Kitten Internet            |    |
| aaron at kitten.net.au           Internet consultancy,      |    |
| Phone: +61-417-625550         System administration,     |    |
| fax: +61-7-36010099           system design/integration. |    |
| icq: 6715521                  http://www.kitten.net.au   |    |
|                                                          |    |
|                                                          |    +
|                                                          |   /
|                                                          |  /
|                                                          | /
|                                                          |/
+----------------------------------------------------------+







More information about the Speakup mailing list