Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Too many open files' error xcode

This is quite odd. I'm not at all sure why I'm getting this error. I deleted the derived data already and I'm not else quite sure where this error is coming from.

This is the first time I've seen it. It used to show up when running my simulator and now it's showing up when running on my phone.

enter image description here

enter image description here

like image 384
James Chen Avatar asked Oct 02 '15 15:10

James Chen


1 Answers

Check the number of file descriptors that can be opened by your shell. Most cases, default will be 256.

ulimit -a

To solve the 'too many open files' issue locally, increase the number of files that can be opened per shell:

ulimit -S -n 2048 #2048 works fine, or you may put other value.

In case it still does not resolve, system settings can be checked the following way:

sysctl kern.maxfiles sysctl kern.maxfilesperproc

If you prefer to increase the limits system wide, go for these:

sysctl -w kern.maxfiles=20480 (or any number) sysctl -w kern.maxfilesperproc=18000 (or any number)

Use sudo at the beginning of the command, in case you get permission denied.

In order to make this a permanent setting, you will need to add it or change default kernal parameters in /etc/sysctl.conf file.

This article explains the details.

like image 92
Daenerys Avatar answered Oct 09 '22 07:10

Daenerys