TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:320] mem vs. swap



On Sun, 31 May 1998 23:57:36 -0500 Ry4an Brase wrote
>While fiddling around on my linux box I herd a lot of hard drive access
>so I check the mem vs swap numbers.  I found that my mem was 12% full
>(I've got 96 megs in now), and the swap was at 38%.  Usually I'm at
>about mem of 40 and Swap near zero.  What could cause such an
>imbalance.  Even now with the system having sat idle for about 10 mins
>I'm at mem 31% and swap 21%.  I'm I funadmentally misunderstanding the
>mem/swap thing?  Thanks.

You might be.

Swap is not merely "overflow" for memory.  That is, it is not
necessary to fill up the memory in order to start placing things
in swap.  Swap is more of an "attic" where the OS puts rarely-used
items.

If you have "free" memory, Linux (and FreeBSD) will attempt to use
as much as practical for buffer cache.  This increases the performance
of disk/file operations, with the performance increase increasing
with more "free" memory.  Thus, it makes sense, for performance
reasons, to swap out items, even if there is more than enough memory
to hold them.

Wasn't Linus quoted as saying "Free memory is wasted memory." once?

-- 
Chris Mikkelson         	mikk0022@maroon.tc.umn.edu
"They that can give up essential liberty to obtain a little temporary
 safety deserve neither liberty nor safety." 
    -- Benjamin Franklin, Historical Review of Pennsylvania, 1759.