Memory Usage by KDE

Jeffrey Wong jmwong at hoku.net
Wed Aug 15 19:48:36 PDT 2001


A couple of things to point out here.  Just because a memory check shows
200M of memory being used, doesn't mean the memory is being used by any
specific program (more on this later).  2nd, which column of the 'top'
display are you using to get these stats?  The number in the size column
is not exactly what you are looking for.  Long explanation on how how
parts of the linux memory subsystem works follows.

First a breakdown of the top display.  The size column lists the total
amount of memory accessed by the a process.  This includes anything that
may have been swapped to disk or taken from a shared memory structure or
linked library.  The RSS column shows the size of all non swapped memory,
but still includes the shared/linked lib memory.  The shared column list
shared/liked lib memory used by the process.  So what is shared mem?  It's
simply that, a segment of memory that is shared by several
processes.  This shared memory will be counted several times if you just
sum the numbers in the size column.  In some cases, shared memory can
account for a large percentage of a process.  One example of this is when
a process forks off instances of itself (like the kdeinit process).  Linux
uses a copy on write fork which will initially have the new instances
using 100% shared memory and as each child process goes on it's own way
the percentage of shared memory generally decreases.  
In addition, the top 'share' column also includes linked libraries.  If
several programs link to the same library call, the the amount of mem used
by that library routine will be counted in each processes 'share' entry,
even though the actual lib routine is only in memory once.  This is one of
the reasons why the shared number in the mem line across the top of the
display never matches what is in the 'share' column, the top number
doesn't include linked lib's, while the 'share' column does.

Unfortunately, even though top is not a good tool for this, I don't really
know of anything better :(

Next, the amount of memory reported as used is not the amount of memory
used by what people generally refer to as used memory (did that sentence
make any sense at all?  Go away, I'm tired).  The general linux attitude
toward memory uses is, if it's there and not being used, it's a wasted
resource.  Generally speaking, on any linux system that's been used for a
while there will less than maybe 10% of memory that's unused, even if at
the time there are no real programs running (by this i mean only the core
system processes are running).  Basically, if linux finds a significant
amount of memory going unused, it'll grab it and use it for file caching
and I/O buffering.  This memory will be freed for use by other processes
whenever needed.  Thus the amount of available memory is the amount top
lists as free + the amount top lists as buffer + the amount used by file
caching (which top doesn't report at all).  The better way to figure the
amount of mem available is to use 'free'. free gives the same numbers for
free mem and buffer mem, but it also gives the amount of mem used for file
caching.  

I'm tired of writing about a boring memory management stuff.  I hated it
in school, I hated it when I had to do memory monitoring stuff, and I hate
it now.

Jeff


On Wed, 15 Aug 2001, W. Wayne Liauh wrote:

> X takes 60.8 M, and there are 7 "kdeinit" processes, each taking about 5 ~ 8 
> M, 2 "kdm" proocesses 14M altogether, "knotify" 8.5M, ksmserver 5.3M, and 
> "xfs" 7.5M.  These are the major memory users.
> 
> On Wednesday 15 August 2001 12:43 pm, you wrote:
> > Can you run "top" and see which process(es) is using that amount of memory?
> >
> > ----- Original Message -----
> > From: "W. Wayne Liauh" <LiauhW001 at Hawaii.rr.com>
> > To: "Linux & Unix Advocates & Users" <luau at list.luau.hi.net>
> > Sent: Wednesday, August 15, 2001 11:05 AM
> > Subject: [luau] Memory Usage by KDE
> >
> > > As I mentioned in a previous thread, without running any program, KDE
> > > takes up about 210 MB RAM.  If I turned the anti-aliasing fonts on, the
> > > memory usage elevated to 230 MB.
> > >
> > > With GNOME, the memory usage was about 67MB.
> > >
> > > Did I do anything wrong?  Thanks.
> >
> > ---
> > You are currently subscribed to luau as: liauhw001 at Hawaii.rr.com
> > To unsubscribe send a blank email to $subst('Email.Unsub')
> 
> ---
> You are currently subscribed to luau as: jmwong at hoku.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> 



More information about the LUAU mailing list