Skip to content

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

@mscdex

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)

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