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 over JMX 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 the [[JMX#Thread_Monitoring_and_Management|"java.lang:type=Threading" platform MBean]], 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 {{Internal|Ulimit#To_Set_A_Value|Change the maximum number of processes allowed to a single user}}
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 {{Internal|Ulimit#To_Set_A_Value|Change the maximum number of processes allowed to a single user}}


For more details on how Java threads map onto Linux processes, see {{Internal|Java_Threads#Java_Threads_and_Linux_Processes|Java Threads and Linux Processes}}
For more details on how Java threads map onto Linux processes, see {{Internal|Java_Threads#Java_Threads_and_Linux_Processes|Java Threads and Linux Processes}}

Revision as of 03:30, 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 the "java.lang:type=Threading" platform MBean, 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

Change the maximum number of processes allowed to a single user

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

Java Threads and Linux Processes