Skip to content

Instantly share code, notes, and snippets.

@dredhorse
Forked from tombigel/README.md
Last active March 19, 2021 16:32
Show Gist options
  • Save dredhorse/786e326aa7253fa31166e6f56855718a to your computer and use it in GitHub Desktop.
Save dredhorse/786e326aa7253fa31166e6f56855718a to your computer and use it in GitHub Desktop.
How to Change Open Files Limit on OS X and macOS Catalina (10.8 - 10.15)

How to Change Open Files Limit on OS X and macOS

_This is a shorter version without changing the limit.maxproc values derived from the original gist.

Please take a look at https://gist.github.com/tombigel/d503800a282fcadbee14b537735d202c before doing anything from this gist

I removed any explenation from this and I also removed the changes to limit.maxproc

For more information about the existence of this gist please look here: https://github.com/dredhorse/SnowWhite/blob/master/this-and-that/unable-to-update-cities-skylines-in-macos-catalina.md

Warning: This might leave your computer in an unusable state if anything goes wrong. In that case boot into recovery mode and remove /Library/LaunchDaemons/limit.maxfiles.plist from you bootdisk. That is not the / you have available in recovery mode!

How to change the values later on without rebooting

Unload Daemon

sudo launchctl unload -w /Library/LaunchDaemons/limit.maxfiles.plist

Change value in /Library/LaunchDaemons/limit.maxfiles.plist

Load Daemon again, to make sure reboot.

sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist

<?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>524288</string>
<string>2147483647</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceIPC</key>
<false/>
</dict>
</plist>
#!/bin/sh
curl -O https://gist.githubusercontent.com/dredhorse/786e326aa7253fa31166e6f56855718a/raw/f620970b6a1c60c1ed813330ecb1baa3fb1f04b7/limit.maxfiles.plist
sudo mv limit.maxfiles.plist /Library/LaunchDaemons
sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist
sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment