We recently resolved a similar problem on a win32 platform which
presented as a java.lang.OutOfMememoryError when attempting to create a
new native thread.

Native threads were being created [each with their own 1Mb stack in the
non-JVM heap space] in association with Thread objects as they were
being managed in the JVM.

In a paradox, increasing the heap available to the JVM can actually
cause a thread-greedy app to fail by limiting the memory available to
native threads.

It's possible to change the default native thread stack size on that
platform, but we didn't go down that route. It turned out to be "thread
leak"; unnecessary threads were being created and the GC wasn't
reclaiming their space [and therefore the native thread stack space].

Brad Harper
EPSIIA Inc.

> -----Original Message-----
> From: Peter Crowther [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 03, 2008 11:34 AM
> To: 'Tomcat Users List'
> Subject: RE: Threads
> 
> > From: Stephen Caine [mailto:[EMAIL PROTECTED] I have 
> a process 
> > that generates hundreds of threads.  Running on Mac OS X 10.5.2 
> > Server, the thread count tops out at approximately 2500.
> > After which, the process is terminated.  The heap size is set to 1 
> > gigabyte.  My question is how to increase the capacity of 
> the JVM to 
> > handle more threads.  Is the value of 2500 an absolute 
> limit, or can 
> > it be modified by setting the thread allocation, increasing 
> heap size 
> > or the use of another java option?
> 
> I'm not a Mac person, but... does the Mac JVM use native 
> threads?  In which case, the 2500 (plus other threads) could 
> be an OS limit that has changed in 10.5.
> 
> > If you have time, what causes a process to generate threads?
> 
> Calls to the API that generates a thread.  Next?
> 
>                 - Peter
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To 
> unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to