One common workaround was to use a pool of threads created at VM startup, rather than creating each new thread on demand.
一个常见的解决方案是使用VM启动时创建的线程池,而不是按需创建每个新线程。
Further, the process will fail to create any new threads since no memory is available for creating new ones.
另外,进程将无法创建新的线程,因为无内存可供创建新线程使用。
This is a recipe for trouble because in some JVMs, creating a Thread is a heavyweight operation, and it's far better to reuse existing Threads than to create new ones.
这可以解决一些问题,因为在一些 JVM 中,创建 Thread 是一项重量型的操作,重用现有 Thread 比创建新线程要容易得多。
应用推荐