[vox-tech] Memory usage puzzle

Jeff Newmiller vox-tech@lists.lugod.org
Fri, 18 Jan 2002 10:30:45 -0800 (PST)


On Fri, 18 Jan 2002, Rod Roark wrote:

> 
> On Thursday 17 January 2002 11:12 pm, Jeff Newmiller wrote:
> > On Wed, 16 Jan 2002, Rod Roark wrote:
> > > Anyone know a good utility that will go through all allocated
> > > memory blocks and tell you which process or executable is
> > > responsible for each one?
> > >
> > > Yes I know about "ps".  I don't think it really does that.  Here's
> > > my problem:
> > >
> > > When I start up my colo box, running ntpd, bind, sshd, postfix,
> > > Courier pop3d/imapd, apache, postgresql, xvnc, one KDE session,
> > > and some other normal stuff, "free" shows about 60 MB in use
> > > (after subtracting buffers and cache).  After a day or two, memory
> > > usage climbs to around 260MB and stays there.  If I stop VNC/KDE,
> > > apache, all mail stuff and the sql server, memory in use still
> > > stays over about 220 MB.
> > >
> > > So, what's using all that memory?  I'd like to find out.
> > >
> > > Total physical memory is 1GB.
> >
> > I didn't see if anyone came up with an answer for this one.
> >
> > Top, with the "M" command, would be my first thought.
> >
> > However, the problem may be associated with shared memory... try
> > looking at "ipcs"?
> 
> Thanks Jeff.  Tell me what you make of the following.  I can't account for 
> the memory usage... can you?
> 
> 
> [rod@www rod]$ free
>              total       used       free     shared    buffers     cached
> Mem:       1030016     993520      36496          0     440700     301620
> -/+ buffers/cache:     251200     778816
> Swap:      1204832        144    1204688

I don't consider myself an expert at Linux system memory
management... much more familiar with the innards of processes than their
construction. But what I see is...

778816 = 36496 + 440700 + 301620

lots of memory available ... 95% of that is in buffers and cache.

993520 = 251200 + 440700 + 301620

245MB are used by non-buffer, non-cache uses.  Does seem like quite a bit
compared to the top output.

> 
> [rod@www rod]$ ipcs -mu

Might want to retry this as root?

> 
> ------ Shared Memory Status --------
> segments allocated 5
> pages allocated 8894
> pages resident  171
> pages swapped   0
> Swap performance: 0 attempts     0 successes
> 
> 
> And the following "top" snapshot:

yeah, this doesn't seem to be illuminating where the memory is.

[...]

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...2k
---------------------------------------------------------------------------