Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

RE: Strange number of processes....

Ralph Einfeldt

2003-12-10


First of all keep in mind that it aren't processes, they are
threads. As the threads share the same memory they do not
use much additionals memory (some memory for the thread local
objects and the thread stack and so on)

I can't explain all your numbers.

- Even the simplest java program has more than one thread.
Depending on the vendor and the vm version you may have
several threads. (Mine has 'Finalizer', 'Reference Handler',
'Suspend Checker Thread', 'VM Periodic Task Thread',
'VM Thread', 'Signal Dispatcher' and 'main')

- Tomcat uses some threads as monitors. The number of monitors
depends on the tomcat version and the services you enable/disable

- There might be no relation between minProcessors and the number
of threads, as it's tomcat's choice if and when additional threads
are created (which may be stored in a thread pool for later reuse).

- If you set minProcessors = maxProcessors this might give a better
relation to the number of threads but there is no contract that
enforces tomcat (or any other servlet container) to limit it self
to a certain amount of threads.

- If you want to know what the threads are doing, you can issue a
'kill -QUIT <jvm-pid>' and look at the stacktrace in catalina.out.
(the thread names give a good hint about purpose)

> -----Original Message-----
> From: Scott Queen [mailto:scott@(protected)]
> Sent: Wednesday, December 10, 2003 2:12 AM
> To: tomcat-user@(protected)
> Cc: scott@(protected)
> Subject: Strange number of processes....
>
>
> Ok.... I'm running Tomcat 4.1.18 as a standalone server on a Linux box.
> I've configured 6 virtual hosts in the Tomcat-Standalone
> server having a
> non-SSL Coyote HTTP/1.1 Connector (probably obvious) and a Coyote/JK2
> AJP 1.3 Connector (I don't think this is used, but I'm not
> sure....unfortunately reveals my lack of experise!).
>
> I'm confused with the number of java processes spawned when I start
> Tomcat. Here is what I see:
>                                 # of initial
> minProcessors | maxProcessors | java processes | comments
>   1          |       1       |      25    
>  | can't
> get a page
>   1          |       2       |      27    
>  | pages
> served to 1 session
>   2          |       4       |      31
>   4          |       4       |      31       | slow
> response, 1 session at a time
>   4          |       7       |      31       | 3
> sessions respond, 4 add'l java procs created
>   5          |       7       |      31       | same
> as above
>   4          |      20       |      31       | 5
> sessions respond (all tested), 9 add'l java procs
>
> So..... First question: why are there so many java processes when I
> specify only a few minProcessors (i.e. 1 minProc, 1 maxProc, 6 virtual
> hosts - I would expect 6 java sessions)? Second question:
> why isn't the
> number of initial java processes a linear relationship relative to the
> number of minProcessors specified?
>
> I'm concerned about this because in the end, only about half the
> processes are ever used, but they all take up a significant amount of
> memory. How do I reduce the memory utilization?
>
> Thanks,
> Scott Queen
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.