tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pier Fumagalli <p...@betaversion.org>
Subject Re: Questions on tomcat heap usage and garbage collection (avoiding OutOfMemoryError exceptions)
Date Thu, 25 Oct 2001 02:08:26 GMT
Bang, Steinar at Steinar.bang@tandbergtv.com wrote:

> Which brings us to question 2: tuning apache/tomcat:
> When reading the documentation, I thought that there
> was supposed to be a single tomcat process, serving
> all requests.  However top reports a lot of tomcat
> processes, when I'm stresstesting the server, which
> leads me to belive that there is a separate tomcat
> process for each apache server process running.
> Is this correct?

Nope.. That's the idiotish implementation of Threads under Linux. Under
Linux every thread is seen as a process by "ps" so, if you have an
application using 500 threads, "ps" will report 500 processes (this is
because Linux has just one scheduling table for all, unlike real operating
systems which have two, and differentiate between threads and processes).

Short test to prove it, you know how much ram you have in your machine, do a
"ps" and see the amount of Ram used by each single "java" process, sum it
all up, see how much swap space you're using, and "tadaaaa" You have more
memory than you thought....

Regarding your OutOfMemoryException, when that's thrown in one thread, all
other threads die too, because all threads reside in the same memory space,
so, if one thread doesn't have memory left, so not even the others. (they're
threads, not processes).

    Pier (I hate Linux's threading model)


Mime
View raw message