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!

About

My name is Mike Haller and I'm a software developer and architect at Bosch Software Innovations in Germany. I love programming, playing games and reading books. I like good food, making photos and learning and mentoring about the craftsmanship of commercial software development. Stack Overflow profile for mhaller

Quicksearch