[NTLUG:Discuss] True memory usage

Chris Cox cjcox at acm.org
Wed Oct 19 22:50:16 CDT 2005


Robert Thompson wrote:
> Hello,
> 
> 	I am trying to figure out the best way to get the 'true' memory usage
> for a machine. When I do a free I think I'm supposed to look at the
> 'used' section under the -/+ buffers/cache line:
> 
> $ free
>              total       used       free     shared    buffers
> cached
> Mem:        904832     895972       8860          0      18060
> 565936
> -/+ buffers/cache:     311976     592856
> Swap:       755044        164     754880
> 
> 	So the above means I am using 311M of memory?
> 
> 	When I attempt to add up the memory from doing a ps aux and adding the
> RSS (resident set size) I get something different (larger than total
> memory):

It can be complicated.  Do you need a VERY exact number?  I would think
the value in free would work fine (or /proc/meminfo).  ps can be
misleading since threaded applications will show up multiple times with
the same RSS (or even SZ) size.  There can be other things shared as
well.





More information about the Discuss mailing list