On Sat, Jul 20, 2002 at 10:44:38PM -0500, Jon Schewe wrote:
> Seeing as Linux gives each thread a PID, top and ps like to tell me that there
> are lots of processes out there using lots of memory and it doesn't add up to
> what's actually being used.  Generally I can figure out which processes are
> forked and thus actual processes and those which are cloned and thus are
> threads.  The difference that I'm interested here is the memory usage.  I'd
> like to be able to just see how much memory the process is using, rather than
> each thread.

It's not quite that simple...  Not only do you have shared libraries
to contend with, but forked processes are copy-on-write, so you can
have an arbitrary number of completely independent (non-thread)
processes which only take up as much memory as a single instance,
provided that they never write to any memory.  (Well, theoretically.
In reality, aside from probably being useless, each process would
have its own call stack and set of registers, but that's not much
memory compared to the size of most software these days.)

-- 
When we reduce our own liberties to stop terrorism, the terrorists
have already won. - reverius

Innocence is no protection when governments go bad. - Tom Swiss