4

According to this stackoverflow post, there is a limit on Mac OS X 10.6 for how many threads can be created by JVM or any application. The limit can be displayed by running following command in terminal:

sysctl kern.num_threads

and

sysctl kern.num_taskthreads

systctl has the possibility to override these values on Linux, however not on OS X. According to this man page, those fields are not changeable.

So my question is, on OS X 10.6, is there another way to override the limit of how many threads can be created?

Community
  • 1
  • 1
Jifeng Zhang
  • 5,037
  • 4
  • 30
  • 43

3 Answers3

3

You may be able to use the 64-bit kernel and a lot of memory to increase the limit. See Understanding process limits (this is about 10.6 Server). I don't know of another way.

Matthijs Bierman
  • 1,720
  • 9
  • 14
-3

use this cmd in ubuntu 12.10

sysctl  -A | grep thread
asraful009
  • 585
  • 1
  • 6
  • 11
-4

If you are reaching this limit perhaps you should think about changing your design. How many cores do you have? The limit is usually set at a level its has been determined the system won't behave particualrly well.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
  • Thanks for your suggestion, it was just an attempt to check how many threads can JVM create on different platform. In a real application, a rethink of design is definitely needed. – Jifeng Zhang Dec 15 '10 at 13:51
  • @Flying Crab, I often see 10K as an upper limit on the number of threads you would want to have. Someimes having more active threads than cores can be counter productive. esp for CPU intensive applications. – Peter Lawrey Dec 15 '10 at 16:58