[ale] Can someone help me understand memory usage?

Jeff Hubbs hbbs at attbi.com
Thu Apr 25 22:10:57 EDT 2002


Chris Fowler wrote:

> A friend just installed 384 megs of memory in his Linux box.  It is still
> swapping to disk.
> 
> Questions:
> 
> 1) What is cahced memory?


That's disk I/O cache (i.e., the red part of the MEM bar in xosview).


> 2) What would there be memory in cache and the box be using swap?


"Caching RAM in RAM" (as long as we aren't talking about L1 cache, L2 
cache, etc.) is a phrase that doesn't make a whole lot of sense.  On my 
box JUANITA (the one I'm typing on right now), I just recently rebooted 
to change out the mouse, and it shows zero swap.  But, xosview is also 
showing that about half of the 512MB of RAM is being used up between 
used+shared, buffer, and cache - and it's slowly growing, even though I 
don't have a lot running right now.  See below.


> 3) Is there a such thing as free memory?


Yeah, but 2.4 kernels are "greedier" than 2.2 and before.  As I 
understand it, you can no longer view gobs and gobs of free RAM as a 
sign of system health.  Rather, the OS stakes out big swaths of 
otherwise unused RAM and hangs onto it.  And, eventually, it will start 
filling up swap.  However, this is not so much a sign of impending 
meltdown as the kernel going, "hm, here's a section of RAM that hasn't 
been used in hours; I'm throwing it to the swap file."

Basically, the memory-health paradigm that I had in my head under VMS, 
NT, and then 2.0 and 2.2 Linux kernels isn't terribly useful anymore. 
Instead, I'd pay more attention to the LOAD and PAGE figures - my logic 
(informed supposition, I admit) being that the way the LOAD measurement 
is calculated has kept pace with what the kernelistas feel is a 
reasonable way to get a subjective figure from objective/empirical data 
and that the amount of disk I/O going into swapping is also meaningful. 
  In other words, when PAGE starts getting significant and stays 
significant (as opposed to significant but very bursty), that's when 
you're headed into the weeds - THAT, I feel, has not changed.


> 
- Jeff



---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list