Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Mac OS X limits number of processes to 266 and open files to 256. Sometimes this is problem; 256 open files and 266 processes aren't that much.

How it's possible to change default ulimit values in Mac OS X 10.6.7?

(Hopefully there's no difference between 10.6.7 and other Snow Leopard releases.)

Related question in serverfault. Unfortunately, answer is for Mac OS X 10.5, and it's not working in 10.6.

share|improve this question
up vote 47 down vote accepted

launchctl has control over that now.

You can do a

launchctl limit maxfiles 2048 2048 

to set the soft and hard limits for maximum files open. For more information see the 'limit' section of:

http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/launchctl.1.html

share|improve this answer
1  
This still works in OS X 10.9 – Olli Feb 16 '14 at 12:03
    
I'm running 10.9.4 and when I launchctl limit maxfiles 2048 2048 and mongo I'm still getting the soft rlimits too low error. Anything else I can try? – Ryan Jul 1 '14 at 15:04
    
after changing the limit with sudo launchctl etc., then close/open the terminal and set the ulimit -n 2048. this time it should work. check it with ulimit -n – chrismarx Feb 6 '15 at 3:47
    
I ran this command and it did something to my Mac. Is it possible to return it to the former setting? – JCraine Apr 17 '15 at 3:23
    
Could someone confirm if 'maxfiles 266 256' will return it to the default? – JCraine Apr 17 '15 at 3:31

There's an answer on StackOverflow for this one. Apparently ulimit does it now.

share|improve this answer
1  
You can change values with ulimit, but it's not saving those. Linked post do not include any way to save defaults. – Olli Apr 6 '11 at 7:22
3  
A quick fix: Edit your ~/.bash_profile and add this on a line: ulimit -n 1024 (using whatever number you like, of course) – PapaFreud Jun 12 '13 at 7:50
1  
@PapaFreud That's only executed when you open the terminal/bash. Not all programs are executed from terminal. – Olli Jan 30 '14 at 14:34

FYI.

.bash_profile update didn't help me for OS v10.10.3, but reinstallation NodeJS from 0.10.35 to 0.12.3 helped me, and error disappear.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .