Java. lang. OutOfMemoryError: unable to create new native thread, createnativethread

Source: Internet
Author: User

Java. lang. OutOfMemoryError: unable to create new native thread, createnativethread

Symptom:

SuperMap iServer is deployed in Tomcat (8.5.13), and the number of concurrent users is around 100. After the system runs for a period of time, the Service crashes. Exception prompt

Problem Analysis:

1. When the prompt information in the log is displayed, the system memory is insufficient. Therefore, a monitoring script (such as) is added to the server to record the system memory and tomcat memory every 1 s.

After monitoring for a period of time, an exception occurs again. No Memory exception found from the log

2. After the memory is exceeded, is it because of the large number of concurrent users that the number of processes exceeds?

1) view the resource limit parameter ulimit-a of the current linux User

2) among the above parameters, the most important concern is the maximum number of files that a process can open, that is, open files. The maximum number of processes allowed to be created is the max user processes parameter. We can use ulimit-u 4096 to modify the value of max user processes, but it only takes effect in the session of the current terminal. After logon, the default value is still used.

The correct modification method is to modify the value in the/etc/security/limits. d/90-nproc.conf file. Let's take a look at what this file contains:

$ cat /etc/security/limits.d/90-nproc.conf # Default limit for number of user's processes to prevent# accidental fork bombs.# See rhbz #432903 for reasoning.*          soft    nproc    4096

You only need to modify the value 4096 in the above file.

After investigation, it is indeed because the maximum number of processes set by the current user on the server is too small, leading to the failure of Process Creation and crash.

 

Reference: http://www.linuxidc.com/Linux/2011-03/33121.htm

Http://www.cnblogs.com/billyxp/archive/2013/04/03/2998079.html

Linux view current process: http:// OS .51cto.com/art/201101/244090.htm

Http://www.linuxidc.com/Linux/2015-01/111270.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.