https://www.macobserver.com/tips/deep-dive/evade-macos-many-open-files-error-pushing-limits/
Archived links:
- page 1 http://archive.is/XttnK
- page 2 http://archive.is/gx6EA
Once your Mac has booted into Recovery Mode, you should click Utilities from the top menu bar, then Terminal. In Terminal, issue the following command:
csrutil disable
Once you’ve logged in, you should once again open Terminal. In Terminal, type the following command:
sudo nano /Library/LaunchDaemons/limit.maxfiles.plist
Paste into that file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>limit.maxfiles</string>
<key>ProgramArguments</key>
<array>
<string>launchctl</string>
<string>limit</string>
<string>maxfiles</string>
<string>64000</string>
<string>524288</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceIPC</key>
<false/>
</dict>
</plist>
Now we can create a similar file to increase the processes limit. Still in Terminal, type this command:
sudo nano /Library/LaunchDaemons/limit.maxproc.plist
Again, you’ll be in a text editor. Copy and paste this content into the file, the same way you did previously for maxfiles.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>limit.maxproc</string>
<key>ProgramArguments</key>
<array>
<string>launchctl</string>
<string>limit</string>
<string>maxproc</string>
<string>2048</string>
<string>4096</string>
</array>
<key>RunAtLoad</key>
<true />
<key>ServiceIPC</key>
<false />
</dict>
</plist>
Finally, reboot your Mac. Back to Recovery Mode we go. You need to again restart your Mac, and hold Command-R until the Apple logo appears. When Recovery Mode has loaded, open Terminal and run this command:
csrutil enable
Reboot again into normal mode.