5.8.4 When Thread Creation Fails
When memory insufficiency (OutOfMemoryError) occurs and a new thread cannot be created, the number of threads at that time is output to the standard output. The threads that could not be created are also included in this number of threads.
An example of output when thread creation failed due to memory insufficiency is as follows:
java.lang.OutOfMemoryError:unable to create new native thread.1200 threads exist. ...
An example of output when thread creation failed at JavaVM startup time is as follows:
Error occurred during initialization of VM Could not create thread for VM:VM Thread.5 threads exist.