[PLUG] Do I need more RAM?y

chris (fool) mccraw gently at gmail.com
Thu Jan 21 17:15:54 UTC 2010


On Wed, Jan 20, 2010 at 20:57, Carlos Konstanski
<ckonstanski at pippiandcarlos.com> wrote:

> I don't think you can tell much from this output because of the usage
> of the disk cache. You would need to run a command like "ps fauxw" and
> examine the memory usage of individual processes.

or an easier way to calculate the same metric, just use the command 'free':

             total       used       free     shared    buffers     cached
Mem:       4052320    4025872      26448          0     219852    1131972
-/+ buffers/cache:    2674048    1378272

here you can see that though top would tell me i only have 26MB of 4GB
free, that i actually have a total of 1.3GB used for file cache and
buffers which would be reallocated for use by running processes before
swap began to be used for anything intensive.

oh, it looks like top gives you that info too--the buffers and cached
(though listed in the 'swap' row, it is about memory i think) numbers
are there too, it just doesn't do the math of giving you the final
math to get the "free" number.

from your numbers, it looks like you could safely swapoff -a and run
without swap (but not with much headroom).

a related question:  do you track memory usage over time?  if the
server's been running for long, memory leaks may have occured that are
eating memory needlessly--programs grabbed memory to do something and
forgot to deallocate it when finished using it.  and then did that a
few, or a few hundred, more times.  not quite apples to apples, but
i'm sure i'm not the only one who has to restart my browser weekly to
reclaim hundreds of megs of active-use memory (even with the same 25
tabs open).



More information about the PLUG mailing list