Skip to content

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

Description

@mscdex
  • 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)

Activity

  1. added
    toolsIssues and PRs related to the tools directory.
    on Mar 8, 2016
  2. jbergstroem commented on Mar 8, 2016

    @jbergstroem
    Member

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

  3. cjihrig commented on Mar 8, 2016

    @cjihrig
    Contributor

    Can we use a .eslintignore file?

  4. mscdex commented on Mar 8, 2016

    @mscdex
    ContributorAuthor

    @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).

  5. Trott commented on Mar 8, 2016

    @Trott
    Member

    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.

  6. mscdex commented on Apr 15, 2016

    @mscdex
    ContributorAuthor

    Fixed by 81fd458.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    toolsIssues and PRs related to the tools directory.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions