[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Memory usage on debian



On Thu, Jan 23, 2003 at 04:30:56PM +0100, Nils-Erik Svangård wrote:
> My system use about 95% of my 512 mb ram, but ps aux and top doesent
> show which process that eats all the memory.
> Can anyone figure out what to do this could be a kernel issue or
> something?

It's normal.  You didn't say where that 95% usage figure came from,
so I'll use free to explain what you're (probably) seeing, since it
shows it all quite clearly.  Here's what my mail server looks like:

~$ free
             total       used       free     shared    buffers cached
Mem:        256904     247056       9848      42176      56616 155868
-/+ buffers/cache:      34572     222332
Swap:      2000052       8436    1991616

256M of RAM and look at that first line - 247M used and only 10M
free!  Heavily loaded?  Nah...  Look at the rest of the line - of the
used memory, 57M is in buffers and 156M is cached disk.  All of this
can be discarded at a moment's notice without hurting anything, so
it's still available even though it's in use.

The second line tells the real story - 35M is being used by things
that can't just be forgotten on a whim and, for all practical
purposes, there's 222M available.  Plenty of memory to go around.

What you're probably seeing is that the kernel, when presented with
lots of available memory, starts caching everything in sight on the
off chance that it might be needed at some point.  If you do end up
needing it, a trip to disk can be avoided, and you get a nice
performance boost.  If it turns out that the memory is needed for
something else, no problem - it just takes a microsecond or two to
make a note that the memory is no longer being used as cache and away
you go.

-- 
The freedoms that we enjoy presently are the most important victories of the
White Hats over the past several millennia, and it is vitally important that
we don't give them up now, only because we are frightened.
  - Eolake Stobblehouse (http://stobblehouse.com/text/battle.html)



Reply to: