Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EMFILE errors on MacOs #109

Open
ssbb opened this issue Feb 14, 2018 · 9 comments
Open

EMFILE errors on MacOs #109

ssbb opened this issue Feb 14, 2018 · 9 comments

Comments

@ssbb
Copy link

ssbb commented Feb 14, 2018

Hi! Great work on this and I want to try Atom only because of this package 👍

But I am unable to use it because of annoying EMFILE errors.

screen shot 2018-02-14 at 7 28 12 am

atom version:

Electron: 1.6.16
Chrome  : 56.0.2924.87
Node    : 7.4.0

elm version:

> elm --version
0.18.0

limit of open files is set to 64k:

> launchctl limit maxfiles

	maxfiles    64000          524288

number of packages in node_modules:

ls -l node_modules | wc -l
    1046

It looks like it hangs when traversing node_modules directory. Errors like on screenshot above just appearing infinitely with high rate. I am able to use elmjutsu when removed ['elm-stuff/exact-dependencies.json', 'elm-package.json', '**/*.elm'] in chokidar config (lib/core.js:327) and replaced it with my elm code directory so it will no look at node_modules at all.

Also I am able to use it with usePolling: true flag.

@OvermindDL1
Copy link

OvermindDL1 commented Feb 14, 2018

That's a common bug on Mac's Sierra and higher, which I'm guessing yours is?

Have you already increased your user's max open file limit (mac's default to painfully low amounts I hear)?

Edit: Also, not an atom-elmjutsu bug, rather it's just a limitation in the default mac setup with file watchers (mac's are getting more developer hostile over time it seems...).

@ssbb
Copy link
Author

ssbb commented Feb 14, 2018

Yeah, increased to 64k as you can see in my original message

@OvermindDL1
Copy link

Yeah, increased to 64k as you can see in my original message

64k still might not be enough depending on the size of your entire workspace directory... ^.^;

How many files does it contain in full?

@ssbb
Copy link
Author

ssbb commented Feb 14, 2018

There is 30625 files total in directory. But this error appears at start of scanning - I am tried to watch how many files open by atom and it was about 240 only when hangs.

@ssbb
Copy link
Author

ssbb commented Feb 14, 2018

240 really looks like file limit reach (256 is default, right?). but ulimit -n shows 64k.

@OvermindDL1
Copy link

What about ulimit -a?
Also what are the limit's of the overall system (launchctl limit maxfiles or something like that if it is the same command as on linux, maybe something like sysctl kernel.maxfiles or so)?
Also after updating the ulimit you restarted your profile and it retained it yes?

@ssbb
Copy link
Author

ssbb commented Feb 14, 2018

output for this commands:

☁  ~  ulimit -a
-t: cpu time (seconds)              unlimited
-f: file size (blocks)              unlimited
-d: data seg size (kbytes)          unlimited
-s: stack size (kbytes)             8192
-c: core file size (blocks)         0
-v: address space (kbytes)          unlimited
-l: locked-in-memory size (kbytes)  unlimited
-u: processes                       2048
-n: file descriptors                64000
☁  ~  launchctl limit maxfiles
	maxfiles    64000          524288         

Yeah, I set this limit about a week ago and restarted many times since then.

@OvermindDL1
Copy link

Hmm if it's still set to 256 somewhere then I'm not sure how mac's set it, I don't use them... ^.^;

Interestingly your ulimit -a is significantly shorter than a linux one, hmm...

@ssbb
Copy link
Author

ssbb commented Feb 14, 2018

I am sure I have no problems with user/system file limit since I am using Wrk actively and it depends on file limit also. there is no problems with Wrk after changing file limit to 64k.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants