Here's a good explanation about the space Java reserves for each thread stack. It's written about Windows, but applies to Solaris, Linux and FreeBSD as well:
Connection scaling in Java
http://www.javaworld.com/javaworld/jw-03-1999/jw-03-volanomark_p.html#sidebar
It's just a matter of dividing the virtual address space (2, 4, or more gigabytes) by the reserved stack size, and then leaving some extra room for the program, the Java heap, and other things that have to fit as well.
The memory is not actually allocated, but it does get reserved, and you eventually run out of room. That's why I appreciate the "-green" option on the Blackdown Java VM. With user-level threads, you can pretty much have all the threads you want (or, on Java 1.3 without the new I/O, all the threads you need).
John Neffenger
Joseph Shraibman wrote:
I'm running:
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)
... on redhat 8.0. I've discovered that I get get somewhere between 3600 and 3700 threads in a jvm without any arguments. If I pass in -Xss100k I can get that up to 8190 threads, but I'm not sure why. How can I maximize the number of threads per jvm?
---------------------------------------------------------------------- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]