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

Error: EMFILE, too many open files #22

Open
linusthe3rd opened this issue Jun 2, 2014 · 3 comments
Open

Error: EMFILE, too many open files #22

linusthe3rd opened this issue Jun 2, 2014 · 3 comments

Comments

@linusthe3rd
Copy link

I have a large JS project whose files I am trying to instrument. When I try to run "grunt instrument" with the following config:

instrument: {
    files: 'src/js/**/*.js',
    options: {
                lazy: true,
                basePath: 'target/coverage/instrument/'
            }
}

I get the following error:

Fatal error: An error occurred in an async call.
cause stack is ...
  Error: EMFILE, open 'src/js/lib/cultures/globalize.culture.hi.js'
async call history is ...
 [ { function: 'readFile',
    location: '/Users/jryding/Development/pure-cloud-browser-app/node_modules/grunt-istanbul/tasks/helpers.js:65:44',
    mapping: 
     { name: 'src/js/lib/cultures/globalize.culture.hi.js',
       code: [Object] } } ]
@linusthe3rd
Copy link
Author

Looking at a similar issue in the istanbul project, the problem there was that the code was asynchronously loading all of the files to run the action against them.

Digging into the error above at helpers.js:65, it looks like that line is also using an async call to load the files we want to instrument.

@taichi
Copy link
Owner

taichi commented Jun 3, 2014

How many files do you want to instrument?

100? 1000? 10000 or more?

@linusthe3rd
Copy link
Author

If i don't ignore ANY files, my project has just over 1000 files to instrument. Ignoring some files (e.g. lib/) bring it down to 600-800 files.

I expect this to grow over time.

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