Java.net.SocketException:Too Many open files

Source: Internet
Author: User

Today, Tomcat found an error every time he ran the mission Java.net.SocketException:Too many open files,

By looking at the document, it was discovered that the system initialization was done by forgetting to set the Ulimit value so that the default value of 1024 was always used.

Then immediately modify the configuration file

echo "* Soft nofile 200000" >>/etc/security/limits.confecho "* hard nofile 200000" >>/etc/security/limits.co Nfulimit-shn 200000 # # Valid for the current window, after closing

But again run the task when found error still, so various search, finally think of Tomcat after modifying Ulimit did not restart. Problem resolution after reboot.


Find related documents for the following reasons:

If program A is already running, Ulimit-n is 1024 at this time;

Then set ulimit-n 2048, then run program B;

Exit the current shell user, login shell again, run program C;

At this time only the B program uses 2048, the other uses is 1024.


Reference: http://www.th7.cn/system/lin/201309/45075.shtml



This article from "Trojan Rain Heart" blog, declined reprint!

Java.net.SocketException:Too Many open files

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.