Skip to contentSkip to conversation

Threading behavior in 2.6.5 may be broken ?

DISCUSSION j.random.programmer 1 participant 1 message Jun 10, 2004

lore
Share & tools
lore
#0 lore raw

Hi all:

This is a followup to my earlier post about threading in 2.6.5

After more experimenting, I have found the following behavior:

Specifying the per-thread maximum stack size to the java JVM allows one to create more threads. For example, specifying 128k of stack per thread (max), allows me to create 6000 threads. By default, I think 2 MB per thread is assigned for that thread's stack space. I don't know if the 2MB is the default in the JVM, glibc, or the kernel.

However, even if I am using 2 MB * 10,000 threads (=20 GB of RAM), the machine _should_ give an out of memory error but should _not_ get totally wedged (so that ctrl-c doesn't work in that shell to break out of the program or ssh is inoperative so I cannot ssh into another shell and kill the jvm).

Best regards,

--j

__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/