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

Re: Red Hat 8.0 swap and memory



Hmm...  A question like this came up on silug-discuss recently.

On Fri, Oct 25, 2002 at 09:54:11AM -0700, Robert Threet wrote:
> I created a RH8 server on a Compaq server with a Smart SCSI Array
> (RAID 5 , five 18GB drives) and 1 GB of RAM and 2GB of swap.  After
> loading and starting KDE, I ran top which reported that it was using
> 400MB of RAM and 0 swap.  While I'm glad it was not using any swap,
> why would it be using 400MB of RAM?!  Is this because of the really
> large swap or the really large hard drive?

Neither.

Take my box as an example...  I have a half gig of RAM and a gig of
swap.  At the moment, it looks like this:

             total       used       free     shared    buffers     cached
Mem:        513420     504964       8456          0      33604     238912
-/+ buffers/cache:     232448     280972
Swap:      1060280     191640     868640

See how I only have 8MB of memory free?  This is a good thing.  Note
the "buffers" and "cached" fields.  (You can ignore that "shared"
field.  That's a value that the kernel no longer keeps track of for
various reasons in 2.4.x and higher.)

You want the kernel to use all available memory for caching data to
and from disk and such.  As memory pressure increases, either the
caches shrink, or stuff gets swapped.  In many cases, you want
long-running idle processes to get swapped out to free up memory for
caching, so that's why you'll often see a box with a ton of RAM
swapping, even though the RAM used by programs is a very small
percentage.

So going back to my box, I could squeeze all my memory use into RAM
and not swap at all, but that would mean I wouldn't have much left for
caching.

So going back to Robert's box, all that 400MB figure means is that
during boot and starting up KDE, the amount of disk touched (and
cached) combined with the amount of RAM actually used by programs
equals 400MB.  In all honesty, I'm a little surprised it's only 400MB.

Steve
-- 
steve@silug.org           | Southern Illinois Linux Users Group
(618)398-7360             | See web site for meeting details.
Steven Pritchard          | http://www.silug.org/

-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.