Maximum number of threads in a JVM?

后端 未结 6 618

What are the maximum number of threads which can be maintained by the Java virtual machine?

I did not explain this in my original question, but I am trying to benchm

6条回答
  •  臣服心动
    2020-12-01 11:35

    Maximum number of threads can also be limited by the JVM implementation and cab be different from a Java virtual machine to another Java virtual machine. For example, in Jikes RVM an array is used to keep information about threads (See line 54 in the Jikes RVM Scheduler source code). In this case, the maximum number of threads cannot exceed the maximum size of an array in Java, which is about 2^32. But you are more likely to hit other OS limits or hardware limits before reaching 2^32 threads.

提交回复
热议问题