Linux fopen function too has open files Error

Source: Internet
Author: User

Cause: the handle is used up.

This can be caused by the following situations:

1: The file handle is not closed, including common files, socket descriptors, and database connections.

2: although all handles are released, they are not manually released. As a result, they accumulate in garbage collection and an error occurs at a certain time.

3: Before fclose (FP), the operating system did not write the file content in the buffer to the disk, resulting in more files opened after multiple writes.

Solution:

1: Use ulimit to modify the value of the file opens option (only use the current session)

2: Echo "8192">/proc/sys/fs/FS-Max restart the computer (not necessarily effective)

3: The best way is to check the source code and modify the error.

 

 

In addition, if fclose (FP), FP does not point to any file, this will causeProgramCrash or memory error.

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.