[CentOS] Swap memory: I can't reconcile this stuff.

Les Mikesell lesmikesell at gmail.com
Mon Jun 5 23:52:18 UTC 2006


On Mon, 2006-06-05 at 18:45 -0400, William L. Maltby wrote:
> I need to look more into it, but before I start the long and arduous
> "googling my life away" process, I figured someone might know the
> answer. I've read the man pages several times and they didn't change!
> :-(
> 
> As normal, while looking at one thing, something else bites my butt. I
> tuned on the swap field in top and sort on it. Here's an edited snippet
> of the results.
> 
> Mem:    775708k total,   764752k used,    10956k free,    60780k buffers
> Swap:  1572856k total,      160k used,  1572696k free,   377324k cached
> 
>   PID  VIRT  RES  SHR %MEM SWAP COMMAND
> 24729  127m  32m  15m  4.3  94m evolution
>  3409 97220 5268 4304  0.7  89m evolution-data-
>  2851  115m  36m 7120  4.8  79m X

[...]

> Note that the summary line says 160k of swap is used. The man pages say
> the summary and the details under "SWAP" are both reported in "k". No
> mention of "m" is made, I presume that it means "megabytes"?
> 
> If so, I can't reconcile what I'm seeing. Free seems to support the
> summary lines.
> 
>              total       used       free...
> Mem:        775708     764772      10936...
> -/+ buffers/cache:     326584     449124
> Swap:      1572856        160    1572696
> 
> Cat of /proc/meminfo also seems to support the summary lines.
> 
> SwapTotal:     1572856 kB
> SwapFree:      1572696 kB
> 
> Now, if I treat all those numbers ending in "m" as megabytes, it doesn't
> take long to see that I've been lied to somewhere along the way. Or
> alternatively, I'm dense and "Just Don't Get It" (TM).

Executables aren't copied into swap - virtual memory is allocated but
they page in on demand directly from the binary file.  So there really
are megs that could swap in if other portions of those programs are
executed even though it isn't in the swap partition you designated.

-- 
  Les Mikesell
    lesmikesell at gmail.com





More information about the CentOS mailing list