> From: Peter Crowther [mailto:[EMAIL PROTECTED] > Subject: RE: Tomcat multithread question on external application > > If I understand you correctly, the only limits are those > imposed by your virtual machine and the memory you can > allocate to Java. Each thread takes a significant amount of > memory, notably for its stack, which I suspect* has to be > allocated on thread creation.
There are actually two stacks for each thread: a Java stack utilized by the JVM and a native one for use by the C/C++ code of the JVM and the OS. The Java stack is allocated in chunks as needed, but the native one gets all of its virtual space at thread creation and also has an unusable guard page for overflow detection. Note that it's not just the JVM that imposes limits on the number of threads, but also the OS, due to internal thread management structures. On 32-bit systems, this limit can get in the way, but it's extremely rare for it to be an issue in a 64-bit environment. > it's ten years since I last looked inside a virtual machine, > and that was Smalltalk not Java! Ah yes, Smalltalk: "I have an orientation, therefore everything is an object", or, "If it's worth doing, it's worth doing to excess." For the OP: punctuation would be appreciated. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]