memory usage

David Kramer david at thekramers.net
Thu May 2 10:55:22 EDT 2002


On Thu, 2 May 2002, Drew Taylor wrote:

> I'm running a kernel 2.4.2-2 (stock from RH 7.1) and am wondering what is 
> the difference between buffers and cached memory? I added 128MB and was 
> surprised to see so little memory free, even knowing that Linux does 
> aggressive caching.
> 
> [drew at nephi]$ cat /proc/meminfo
>          total:    used:    free:  shared: buffers:  cached:
> Mem:  195735552 194052096  1683456        0 13651968 122585088
> Swap: 205590528   290816 205299712
> MemTotal:       191148 kB
> MemFree:          1644 kB
> MemShared:           0 kB

Linux, as well as most versions of UNIX, take whatever memory they think 
the system can spare and use it for disk cache.  It's not really "used" in 
that it is not allocated to a userspace program.  Even though you only 
have 1644K real memory free, you can allocate much more than that, because 
as the system needs more memory it will take blocks of it out of service 
as disk cache and allocate it to the user.

Because of this, it may be hard to come up with a definitive number of 
"free memory".  AIX has a very wacky scheme that makes it virtualy 
impossible, but at least here under Linux you are told how much is being 
used for cache buffers.

----------------------------------------------------------------------------
DDDD   David Kramer         david at thekramers.net       http://thekramers.net
DK KD  
DKK D  You don't usually hear "hydraulics" and "simplicity" 
DK KD  in the same sentence.
DDDD                                             Cathy Rogers, Junkyard Wars




More information about the Discuss mailing list