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

Source: Internet
Author: User

When the Tomcat Web Project stress test was tested for a few seconds, the Web service started unresponsive. The following error is seen in the Tomcat log:

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

Check the following the number of threads opened by this process is 3366

22750 WC -l3366

At this time, the memory consumption is not big, and then use ulimit-a to view the restrictions, found that MAX user processes is only 4096.

Then modify/etc/security/limits.conf and add the following below (WebAdmin is the user who started Tomcat):

Root        -       nofile  655360root        -       nproc   655360WebAdmin        -       nofile  409600webadmin        -       nproc   409600

And then look at Ulimit, there's no problem.

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

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.