Skip to content

Instantly share code, notes, and snippets.

@agarman
Last active February 14, 2017 04:41
Show Gist options
  • Save agarman/eda7482bcb63f0c86a63877a8bf2d7ae to your computer and use it in GitHub Desktop.
Save agarman/eda7482bcb63f0c86a63877a8bf2d7ae to your computer and use it in GitHub Desktop.
Setting max files in OS X

With thanks to http://superuser.com/a/1171026/39144

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):
<?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>
  1. Change the owner of your new file:
sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist
  1. Load these new settings:
sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist
  1. Finally, check that the limits are correct:
launchctl limit maxfiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment