Where have all the threads gone?
Posted by Mike Haller
on Monday, July 6. 2009
at 15:37
in Java
Recently, we got a nasty error in the log file:java.lang.OutOfMemoryError: unable to create new native thread
Although we had specified
-XX:HeapDumpOnOutOfMemoryError, this does not include dumping the heap to disk when the heap is not involved in an OutOfMemoryError. In this case, the JVM was unable to create new threads as the limit of threads was reached.So, the question is: How many threads can be created?
The answer is, as usual: It depends!
