Mostly rants about being a programmer

MacOS High Sierra and “Too Many Open Files”

While preparing next version of Dinamica EGO for Mac, I was facing the “Too Many Open files” error with a couple of boost::filesystem::stream‘s. Turns out, Apple limits the number of handles you can open in every application (in my installation, up to 256 handles). You can check how many handles your process support by using:

ulimit -a

and checking the “open files” line. To overcome this limitation, I found this awesome blog post, which is still valid on MacOS High Sierra.

To prevent myself (and readers) from losing the details, I am copying the important bits from Dejan Kitic blog:

Create the file /Library/LaunchDaemons/limit.maxfiles.plist with the contents: