Created
March 16, 2017 08:45
-
-
Save tylergets/90f7e61314821864951e58d57dfc9acd to your computer and use it in GitHub Desktop.
Change the open file limit on OSX Sierra.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Thanks to https://superuser.com/a/1171028 | |
echo "This script increases the max files a proccess can have open in OSX Sierra." | |
echo "It should improve IDE performance in large projects with multiple watchers." | |
set -e | |
plistcontent=$(cat <<EOF | |
<?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> | |
) | |
#Save LaunchDaemon | |
echo -e "$plistcontent" | sudo tee /Library/LaunchDaemons/limit.maxfiles.plist > /dev/null | |
#Set permissions | |
sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist | |
#Load settings | |
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
typo in
process
at line 3 😁