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

tools: make jslint crashes with out of memory error #5595

Closed
mscdex opened this issue Mar 8, 2016 · 5 comments
Closed

tools: make jslint crashes with out of memory error #5595

mscdex opened this issue Mar 8, 2016 · 5 comments
Labels
tools Issues and PRs related to the tools directory.

Comments

@mscdex
Copy link
Contributor

mscdex commented Mar 8, 2016

  • Version: master
  • Platform: n/a
  • Subsystem: tools

I think it may have something to do with the number of files being linted? For example, I have benchmark/tmp filled as a result of running the benchmark/module/module-loader.js benchmark, which by default generates 50,000 module directories.

If I remove the benchmark/tmp directory, everything works fine and make jslint doesn't crash.

Without looking, my guess is that it has to do with eslint buffering the linting results for display at the very end. If my hunch is correct, perhaps it should be tweaked so that linting results are streamed instead of buffered?

FWIW here is the output from the crash:

./node tools/eslint/bin/eslint.js benchmark lib src test tools/doc \
  tools/eslint-rules --rulesdir tools/eslint-rules

<--- Last few GCs --->

  125210 ms: Mark-sweep 607.6 (1434.4) -> 605.8 (1434.4) MB, 296.3 / 0 ms [allocation failure] [GC in old space requested].
  125506 ms: Mark-sweep 605.8 (1434.4) -> 605.6 (1434.4) MB, 295.9 / 0 ms [allocation failure] [GC in old space requested].
  125812 ms: Mark-sweep 605.6 (1434.4) -> 605.6 (1434.4) MB, 306.3 / 0 ms [last resort gc].
  126117 ms: Mark-sweep 605.6 (1434.4) -> 605.0 (1434.4) MB, 305.1 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x1bfd6dac1ec1 <JS Object>
    2: readBlockMapping(aka readBlockMapping) [/home/mscdex/git/node/tools/eslint/node_modules/js-yaml/lib/js-yaml/loader.js:1003] [pc=0x2ece2d80ebee] (this=0x1bfd6da04189 <undefined>,state=0x2ab553c22ee9 <a State with map 0x150b17bf0431>,nodeIndent=2,flowIndent=1)
    3: composeNode(aka composeNode) [/home/mscdex/git/node/tools/eslint/node_modules/js-yaml/lib/js-yaml/loader.js:~1251] [pc=0x2ec...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
Makefile:584: recipe for target 'jslint' failed
make: *** [jslint] Aborted (core dumped)
@mscdex mscdex added the tools Issues and PRs related to the tools directory. label Mar 8, 2016
@jbergstroem
Copy link
Member

How about generating a list with find with maxdepth/name *.js, etc and pass that to eslint to avoid traversing?

@cjihrig
Copy link
Contributor

cjihrig commented Mar 8, 2016

Can we use a .eslintignore file?

@mscdex
Copy link
Contributor Author

mscdex commented Mar 8, 2016

@jbergstroem I'm not sure that would work on Windows?

IMHO I would rather see this properly fixed as I wouldn't expect eslint or its dependencies to chew through that much memory (even if it doesn't crash).

@Trott
Copy link
Member

Trott commented Mar 8, 2016

I think I ran into this too with a directory in benchmark, probably tmp like you're saying. The solution is probably to add **/tmp to the .eslintignore file.

@mscdex
Copy link
Contributor Author

mscdex commented Apr 15, 2016

Fixed by 81fd458.

@mscdex mscdex closed this as completed Apr 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools Issues and PRs related to the tools directory.
Projects
None yet
Development

No branches or pull requests

4 participants