Max User Processes and Java OutOfMemoryError "unable to create new native thread": Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 13: Line 13:
</pre>
</pre>


java.lang.OutOfMemoryError "unable to create new native thread" is usually the result of the java process attempting to create more threads than what is allowed at user or system level. For more details, see "[[Linux_Process_Management_Concepts#Maximum_Number_of_Processes_Allowed_on_the_System|maximum number of processes allowed on a system]]" and "[[Linux_Process_Management_Concepts#Maximum_Number_of_Processes_Available_to_a_Single_User|maximum number of processes available to a single user]]". To figure out the number of threads, read it from "", or externally from the O/S-level representation of the Java process, as described here: "".
java.lang.OutOfMemoryError "unable to create new native thread" is usually the result of the java process attempting to create more threads than what is allowed at user or system level. For more details, see "[[Linux_Process_Management_Concepts#Maximum_Number_of_Processes_Allowed_on_the_System|maximum number of processes allowed on a system]]" and "[[Linux_Process_Management_Concepts#Maximum_Number_of_Processes_Available_to_a_Single_User|maximum number of processes available to a single user]]". To figure out the number of threads, read it over JMX from "", or externally from the O/S-level representation of the Java process, as described here: "".


The number of threads cannot exceed the value returned by <tt>ulimit -u</tt>. The same value is reported as "max user processes " by <tt>ulimit -a</tt>. To increase the limit, see:
The number of threads cannot exceed the value returned by <tt>ulimit -u</tt>. The same value is reported as "max user processes " by <tt>ulimit -a</tt>. To increase the limit, see:

Revision as of 02:37, 22 April 2017

Internal

Overview

java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start0(Native Method) [rt.jar:1.8.0_51]
        at java.lang.Thread.start(Thread.java:714) [rt.jar:1.8.0_51]
        ...

java.lang.OutOfMemoryError "unable to create new native thread" is usually the result of the java process attempting to create more threads than what is allowed at user or system level. For more details, see "maximum number of processes allowed on a system" and "maximum number of processes available to a single user". To figure out the number of threads, read it over JMX from "", or externally from the O/S-level representation of the Java process, as described here: "".

The number of threads cannot exceed the value returned by ulimit -u. The same value is reported as "max user processes " by ulimit -a. To increase the limit, see:

ulimit /etc/security/limits.conf

For more details on how Java threads map onto Linux processes, see

Java Threads and Linux Processes