Can't get past 2542 Threads in Java on 4GB iMac OSX 10.6.3 Snow Leopard (32bit)

前端 未结 4 1993
天命终不由人
天命终不由人 2020-11-30 10:34

I am running the following program trying to figure out how to configure my JVM to get the maximum number of threads my machine can support. For those that might not know, S

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-30 11:27

    2542 seems like an arbitrary number:

    I shut all programs down except the one terminal window I was running my test from and I got to 2545, that told me it was an arbitrary limit.

    To get the number of threads for OSX 10.6.3 you do:

    > sysctl kern.num_threads
    kern.num_threads: 2560
    

    and

    > sysctl kern.num_taskthreads
    kern.num_taskthreads: 2560
    

    The 2560 number matches up with the 2542 and 2545 because there are obviously other threads running in the background. According to the official documentation kern.num_taskthreads can not be adjusted in the desktop version of OSX.

提交回复
热议问题