This depends on the CPU you're using, on the OS, on what other processes are doing, on what Java release you're using, and other factors. I've seen a Windows server have > 6500 Threads before bringing the machine down. Most of the threads were not doing anything, of course. Once the machine hit around 6500 Threads (in Java), the whole machine started to have problems and become unstable.
我的经验表明,Java(最新版本)可以轻松地使用计算机本身可以承载的线程数,而不会出现问题.
当然,您必须有足够的RAM,并且必须用足够的内存启动Java,以完成线程正在做的所有事情,并 for each 线程提供一个堆栈.任何拥有现代CPU(最新几代的AMD或Intel)和1-2G内存(取决于操作系统)的机器都可以轻松支持具有thousands个线程的JVM.
如果你需要一个比这更具体的答案,你最好的办法就是分析.