Neale Ferguson wrote: >I have a program that attempts to spawn several hundred threads. When it >gets to 445 it complains about not enough storage. Okay. I up the guest from >256M to 384. No luck, same problem. I set kernel.thread-max up to 16384. >Still no good. I up the ulimit on the stacksize to unlimited. No joy either. >Does anyone have any suggestions as to what knob to twiddle?
Each thread needs a stack; the default thread stack size is 2 MB. 445 threads thus need 890 MB address space, which is about the maximum you can expect on s390 (mmap allocation starts above 1 GB and is limited by the address space limit of 2 GB). I'd suggest to reduce the thread stack size (pthread_attr_setstacksize or so); if you really need many large thread stacks, you can try to play with /proc/<...>/map_base on distros that have it, or else go to 64 bit ... Bye, Ulrich -- Dr. Ulrich Weigand [EMAIL PROTECTED]
