[Gllug] memory usage in linux

Dave Cridland dave at cridland.net
Tue Aug 27 23:22:19 UTC 2002


On Tue, 2002-08-27 at 23:59, Pavel Bradut Boghita wrote:
> Thanks a lot for so much insight. This stuff is really interesting. I think I 
> understood the bit about caching, but then.... where do I see how much memory 
> is actually being used to keep the process running ? For example GIMP asks me 
> how much memory am I going to allocate taking into account what other 
> processes will use. How would I best allocate this memory ?

[dwd at turner dwd]$ free -m
             total       used       free     shared    buffers    cached
Mem:           754        746          7          0         25       382
-/+ buffers/cache:        338        416
Swap:         1035        186        848

"free -m" gives me the memory usage breakdown in Megabytes.

This is user memory only - that is, not kernel memory, which is
subtracted (this is a 768M machine, so about 14M has been used by the
kernel for something or other.)

The second line gives me the memory used and free assuming that buffers
and cache are discounted. In this case, I get 416M "free" - that is,
free to use for processes.

You'll note that this machine has swapped 186M anyway, possibly because
I had something big running earlier, possibly because Linux just likes
to swap things sometimes. This is okay - the machine isn't actually
swapping right now. I can tell this by running "vmstat 1", and watching
the "so" column.

Hope that helps. I've carefully ignored talking about ps, since David is
doing that angle. It is equally useful, though.

Dave.


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list