Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource limit hit on OSX #101

Closed
gregmagolan opened this issue Dec 12, 2017 · 5 comments
Closed

Resource limit hit on OSX #101

gregmagolan opened this issue Dec 12, 2017 · 5 comments

Comments

@gregmagolan
Copy link
Contributor

gregmagolan commented Dec 12, 2017

In order to get iBazel to work on OSX I needed to increase the resource limit for open files.

Used the approach suggested here: https://superuser.com/questions/827984/open-files-limit-does-not-work-as-before-in-osx-yosemite

It seems like there is an entirely different method for changing the open files limit for each version of OS X!

For OS X Sierra (10.12.X) you need to:

  1. In Library/LaunchDaemons create a file named limit.maxfiles.plist and paste the following in (feel free to change the two numbers (which are the soft and hard limits, respectively):
Label limit.maxfiles ProgramArguments launchctl limit maxfiles 64000 524288 RunAtLoad ServiceIPC 2. Change the owner of your new file:

sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist
3. Load these new settings:

sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist
4. Finally, check that the limits are correct:

launchctl limit maxfiles

This works for OSX 10.13 (High Sierra), however I get warnings whenever running iBazel that look like this: Warning: failed to raise resource limit 8 to 524288: Invalid argument

Not sure what the best solution is. If a manual resource limit change on OSX is needed then perhaps it should be suggested in the README. From the warning above it seems that iBazel is attempting to increase the resource limit but failing?

There are also side-effects to increasing the resource limit manually as it may break other applications. Adobe Illustrator, for example, doesn't open up anymore for me with the error: unable to set maximum number of files to be opened.

@gregmagolan
Copy link
Contributor Author

Also noticed this issue on fsnotify with no clear solution: howeyc/fsnotify#89

@gregmagolan
Copy link
Contributor Author

gregmagolan commented Dec 12, 2017

Ideal solution I think would be for iBazel to programatically increase the resource limit if it is on OSX for the process when it starts up

@gregmagolan
Copy link
Contributor Author

Just realized that the Warning: failed to raise resource limit 8 to 524288: Invalid argument comes from Bazel and not iBazel

@adamyi
Copy link

adamyi commented Mar 4, 2018

I have this problem as well. Is there an issue in the Bazel repo for this now?

@achew22
Copy link
Member

achew22 commented May 31, 2018

This was fixed by #125

@achew22 achew22 closed this as completed May 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants