Fix "fork: resource temporarily unavailable" on OS X / macOS
If your computer is routinely bumping up against process limits and it is not due to some runaway program or malware, then instead of trying to override the defaults, you should switch to a different set of defaults known as "Performance Mode" (a.k.a. "Server Performance Mode" or perfmode or serverperfmode).

To do this on El Capitan (and later macOS versions until further notice), you do not need to create new files or mess with turning SIP on or off, all you need to do is 

$ sudo nvram boot-args="serverperfmode=1 $(nvram boot-args 2&gt;/dev/null | cut -f 2-)"


This is officially supported by Apple, and changes the default configuration of your computer from an interactive computer you are going to use for email and web browsing to a server you are going to use to run a lot of non-interactive software. 

The new limits depend on how much memory you have and require you have at least 16 GiB of memory installed, but at a minimum, you will see your user limit on the number of processes you can run increase from 709 to 3,750 and many other limits are increased. Most importantly, systemwide limits will also increase so that a single rogue user or program will not be able to crash the system through resource exhaustion. 

This is a much better way to increase your system limits because it increases all the interrelated limits in a consistent way, taking into account the capabilities of your specific computer. It's also much easier to do. The only downside is that if you ever reset your NVRAM, you will need to run the nvram command again to turn performance mode back on. But that is also a plus, because if the new settings really get you into trouble, all you need to do to undo them is reset your NVRAM, which is a normal step in recovering when things go really bad. If you instead created the LauchDaemons plist files some people suggest, you would have to remember about them to remember to edit or delete them to get back to a standard configuration.