Too many open files, unable to compile

333 views
Skip to first unread message

Edbert Chan

unread,
Apr 13, 2022, 5:19:38 PM4/13/22
to bazel-discuss
We are running into an issue where when we build an Android app, we are getting hit with "Too many open files" error messages. This appears in various forms but they are all the same message.

This error will occur on our Macs but not our ssh remote environments. The difference between the two appears to be that our remote environments have about 100x more file descriptors available to them. 

The error also appears to have been caused by a change between 4.2.0 and 5.1.0 since we did not hit this before.

Here is what we have tried:
1) Raising the limit of the FD's with ulimit 
2) launchtl limit maxfiles
3) Restricting the number of jobs. It appears that we have success if we restrict the number of jobs to 4 or less.
4) lsof to try and track fd usage. Unfortunately, we cannot catch any of the child processes that are spun up by Bazel.

Gaurav Nanda

unread,
Jan 28, 2023, 12:13:31 AM1/28/23
to bazel-discuss
Did you find any workaround?
Reply all
Reply to author
Forward
0 new messages