-
Notifications
You must be signed in to change notification settings - Fork 102
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
Crashes with "EMFILE: too many open files" on large projects #48
Comments
Hey, well, 35,085 files probably too much for Nodejs too keep in memory, I tested on projects with ~5k files. That means I need to add chunks while doing initial scan of project source, it shouldn’t be too hard. |
@alltom hi, how is it going. I've been thinking to add global patch for fs: // Make sure to read the caveat below.
var realFs = require('fs')
var gracefulFs = require('graceful-fs')
gracefulFs.gracefulify(realFs) by https://github.com/isaacs/node-graceful-fs. And probably activate it by CLI param, disable by default since it might causes performance issues. And more I think about that, more doubts I have 🤔 Can you please confirm that 35k files is a reasonable number of files? I.e. it's not Or, may you consider to change increase limits on OS level? Let's discuss. Thanks. |
*yeah, after my first reply I noticed that the bug is inside |
It's actually a Go project, for the most part. (I cloned the Java support files to add Go support. :) The biggest chunk of files, though, is a sub-directory containing a third party library I included in my project that has code in a variety of languages. I could easily exclude that if there were a command-line flag for it. The only directory in there that looks like codecrumbs could ignore as a rule is a Python site-packages directory. |
I see, thanks. Well, then I will add CLI params to “exclude” directories, this will be the first step. Also, I probably need to add filtering for default folders with dependencies per language, currently there is only |
@alltom hi there, sorry this took so long, was in the middle of another feature ;) I pushed quick fix to exclude directories by CLI param, should solve your problem for now. Hope that helps. Ping me if anything. |
Awesome, thank you! I'll give it a shot.
… |
I'm having the same problem, but in Windows 10 with a C++ project. It has 9.107 files with 721 folders and keeps giving me a crashing message similar to @alltom 's: Error: EMFILE: too many open files, open 'C:\Users\xxxxxxx\AppData\Local\Yarn\Data\global\node_modules\to-regex\node_modules\extend-shallow\index.js' |
Do you need 9k files? Try to exclude folders you don’t need by |
Unfortunately, yes. Because there are several libraries linked to the project which are being used on code. |
Alright, then I need to fix that) |
Bogdan, nevermind, I looked after the code and it seems that it's working now. I'm sorry for the issue tracked, and thanks for your attention! :) |
Sorry, didn’t really have time to look at this, was working on other features :) just so you know, there is |
My project has 35,085 files in 3,652 directories. When I load the web interface, it fails with:
macOS 10.14.3
Node 11.11.0
codecrumbs 0732382
The text was updated successfully, but these errors were encountered: