Check the open FD limit for a given process in Linux

后端 未结 7 1643
粉色の甜心
粉色の甜心 2020-12-04 10:13

I recently had a Linux process which “leaked” file descriptors: It opened them and didn\'t properly close some of them.

If I had monitored this, I could tell – in adv

7条回答
  •  有刺的猬
    2020-12-04 10:48

    In CentOS 6 and below (anything using GCC 3), you may find that adjusting the kernel limits does not resolve the issue. This is because there is a FD_SETSIZE value that is set at compile time in use by GCC. For this, you will need to increase the value and then re-compile the process.

    Also, you may find that you are leaking file descriptors due to known issues in libpthread if you are using that library. This call was integrated into GCC in GCC 4 / CentOS7 / RHEL 7 and this seems to have fixed the threading issues.

提交回复
热议问题