[Gllug] memory usage in linux

Pavel Bradut Boghita bradut at freeuk.com
Wed Aug 28 00:05:40 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.

Wow I am definitely on a great list here...
Guys I am really grateful for you time on this.
Dave, applying your calculations, I have 363 used memory, I am discounting 
the 166 (buffers) and 125 (cached) and that leaves me with 72 megs used for 
processes which leaves me with a cool 314 available for further processes ?
I am in the process of studying cache alocation for Postgresql, so your 
explanations went a long way in helping me do this the right way (as well as 
understand other docs I found on the net on this issue)

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




More information about the GLLUG mailing list