[Gllug] memory usage in linux

Dave Cridland dave at cridland.net
Wed Aug 28 10:08:28 UTC 2002


On Wed, 2002-08-28 at 01:05, Pavel Bradut Boghita wrote:
> Wow I am definitely on a great list here...

Yep. I've picked up a lot of clues of these folk.

> Guys I am really grateful for you time on this.

Always a pleasure to make ourselves feel important. ;-)

> 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)

Yes, you probably do have 314M "free" on the box, but remember three
things:

1) Linux has allocated the memory to buffers and disk cache. This *may*
mean that it actually needs it, or it may have done so simply because it
*can*. Again, vmstat will tell you which, have a look at the two "io"
columns, "bi" and "bo". These are actual disk writes.

2) You'll never know whether you're allocating internal process buffers
correctly except by trial and error, I'm afraid. Postgres won't really
be using the disk cache much, since it caches internally in any case,
but other things will. Play will the various "memory usage" figures you
have available until things seem "right". Basically just fiddle until
you have the minimum disk activity - generally, when the "swap" and "io"
columns of vmstat appear to be lowest.

3) Use of swap is not bad. Actually, its good. Active swapping is bad.
Many programs - X itself is a good example - can be apparently heavily
swapped out with no detrimental effect. (In my case, X is using about
133M of swap, but I have no swap activity at the moment.) This is great,
since I have more memory being used for active things like disk caching.

Have fun tinkering.

Dave.


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




More information about the GLLUG mailing list