On Thu, May 11, 2000 at 06:21:49PM +1000, Cantanker wrote:
> Any kernel gurus out there? I've got myself a sparkling brand new copy of
> licq. As I've found out, it's threaded, but 'top' shows the threads
> separately:
> 
>   PID USER     PRI  NI  SIZE  RSS SHARE STAT  LIB %CPU %MEM   TIME COMMAND
>  9597 az         0   0  5828 5828  4332 S       0  0.0  4.5   0:00 licq
>  9600 az         0   0  5828 5828  4332 S       0  0.0  4.5   0:00 licq
>  9601 az         0   0  5828 5828  4332 S       0  0.0  4.5   0:00 licq
>  9602 az         0   0  5828 5828  4332 S       0  0.0  4.5   0:00 licq
>  9603 az         0   0  5828 5828  4332 S       0  0.0  4.5   0:00 licq

kernel threads in linux don't share pids -- each thread gets its
own pid. however they share their address space (hence the five
threads listed above refer to the same memory).

check out the last section of the linux threads faq at:
http://pauillac.inria.fr/~xleroy/linuxthreads/faq.html
for an explanation.

> 
> The reply I got from the licq-main list follows:
> 
> ----- Forwarded message from XXXXX  -----
> 
> Date: Thu, 11 May 2000 08:57:00 +0200
> To: [EMAIL PROTECTED]
> 
> On Don, 11 Mai 2000, Cantanker wrote:
> 
> > I was just wondering, is licq supposed to spawn 5 copies of itself and use
> > 30MB of memory? (That's the qt version.) Seems strange to me...
> 
> It does not. Licq is a multithreaded application, and Linux displays threads
> similiar to processes. 
> 
> Licq Qt-GUI uses about 900kb of memory. You're looking at the value that is
> the mapped address space and not the memory usage. 
> 
> As this value is useless, kernel 2.4 does not calculcate it any more. 
> 
> ----- End forwarded message -----
> 
> Now, questions. I'm running 2.3.99, but the 'top' output above is from this
> kernel. So how much is a development kernel a preview of the next stable
> kernel?

that's it -- there's no secret changes waiting in the wings for 2.4
that aren't going into 2.3.x first -- the licq developers were
simply steering you towards stable kernel releases.

> 
> Also, how accurate is this 'top' output? Is it showing, as the reply
> suggested, the *shared*, *mapped* address space? And is this the same for
> all processes? (Like gnome, which, according to 'top', seems to really hog
> memory, 4mb for the panel and *each* applet, not to mention Netscape.)

"shared" here refers to the fact that the threads share the address
space. When a thread is started up, and the kernel needs to give it
an address space to stomp around in, it gives it an already existing
one rather than making it a new one for it.

"mapped" refers to the entire range of addresses the program may
refer to, including shared libraries that get mapped in. This is way
more than the amount of memory the program will actually use. The
licq guy was pointing out that the Licq Qt-GUI doesn't even really
take up 6MB of memory.

the gnome libraries are huge, but again these are incestuously
shared by all the gnome apps (eg. the panel and each panel applet for
starters) so the actual memory usage is not 4MB times the number of
applets.

netscape is a huge pile of crud.

now go and read (at least) the chapters on 'memory management' and
'processes' in "The Linux Kernel":

http://www.linuxdoc.org/LDP/tlk/tlk.html

Conrad.
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text

Reply via email to