Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Issue - MacOS file limits

FeatureBase Community may exceed open file limits because:

  • the database may be split into a large number of files
  • these files may be open simultaneously.

Possible cause

Maximum file limits may be set incorrectly:

  • in featurebase.conf
  • for the current session
  • for persistent sessions

Solution - Persistent change to open file limit

Setup your system to run the launchctl limit... command on startup.

Step 1 - Disable SIP

  • Enter recovery mode by restarting MacOS while holding down CMD + R
  • Open a CLI then run the following command:
csrutil disable
  • Restart MacOS

Step 2 - Create new LaunchDaemons files

New LaunchDaemon files can be setup to increase file limits.

  • Open a CLI then CD to /Library/LaunchDaemons/
  • Create a new file limit.maxfiles.plist
  • Paste the following XML to the file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
  • Save the file.

Step 3 - change ownership and tell system to run the file

  • Run the following command to change ownership of the file:
chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist
  • Run the following launchd command to launch the file at startup:
launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist

Step 4 - Verify file limit has been changed

  • Run the following command:
launchctl limit maxfiles

Step 5 - Turn SIP back on

  • Open Recovery Mode by restarting MacOS whilst pressing CMD + R
  • Open a CLI and run the following command:
csrutil enable
  • Restart MacOS

Further information