Max User Processes and Java OutOfMemoryError "unable to create new native thread": Difference between revisions
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 | 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, monitor the JVM, or use MCS, or read that number from /proc <font color=red>TODO: how?</font>. | To figure out the number of threads, monitor the JVM, or use MCS, or read that number from /proc <font color=red>TODO: how?</font>. |
Revision as of 02:31, 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, monitor the JVM, or use MCS, or read that number from /proc TODO: how?.
Then, read the number of maximum user processes allowed for the UNIX user that runs that JVM. Look for "max user processes":
[jbossusr@tcffevt1r6ap02 ~]$ ulimit -an core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 127470 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 16384 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max user processes (-u) 1024 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
or
ulimit -u
Then increase that number in /etc/security/limits.conf.
Also see:
For more details on how Java threads map onto Linux processes, see