reviewdog / action-eslint

Run eslint with reviewdog
https://github.com/marketplace?type=actions&query=reviewdog
MIT License
233 stars 63 forks source link

JavaScript heap out of memory #61

Closed taltcher closed 2 years ago

taltcher commented 4 years ago

During our PR workflow, we are receiving: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

This is the GitHub hook we have created:

name: lint
on: [pull_request]
jobs:
  eslint:
    name: runner / eslint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: eslint
        uses: reviewdog/action-eslint@v1
        with:
          reporter: github-pr-review

This is the full log we receive during the workflow run:

Run reviewdog/action-eslint@v1
/usr/bin/docker run --name bb10f3e4af857a45472093426cabfeec8433_99aaa1 --label 54bb10 --workdir /github/workspace --rm -e INPUT_REPORTER -e INPUT_GITHUB_TOKEN -e INPUT_LEVEL -e INPUT_FILTER_MODE -e INPUT_FAIL_ON_ERROR -e INPUT_REVIEWDOG_FLAGS -e INPUT_ESLINT_FLAGS -e INPUT_WORKDIR -e INPUT_TOOL_NAME -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/frontend/frontend":"/github/workspace" 54bb10:f3e4af857a45472093426cabfeec8433

<--- Last few GCs --->

[18:0x55a770f596a0]   234907 ms: Scavenge 1958.5 (2078.7) -> 1953.4 (2079.9) MB, 69.3 / 0.2 ms  (average mu = 0.187, current mu = 0.104) allocation failure 
[18:0x55a770f596a0]   235089 ms: Scavenge 1965.6 (2079.9) -> 1958.9 (2083.2) MB, 23.3 / 0.1 ms  (average mu = 0.187, current mu = 0.104) allocation failure 
[18:0x55a770f596a0]   238342 ms: Mark-sweep 1969.3 (2083.2) -> 1949.7 (2088.2) MB, 3023.8 / 27.3 ms  (average mu = 0.207, current mu = 0.226) allocation failure scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Aborted (core dumped)
/entrypoint.sh: line 12: /github/workspace/node_modules/.bin/eslint: not found
/entrypoint.sh: line 14: /github/workspace/node_modules/.bin/eslint: not found
reviewdog: parse error: failed to unmarshal rdjson (DiagnosticResult): proto: syntax error (line 1:1): unexpected token 

What can cause this issue?

cktang88 commented 3 years ago

also having this issue

yshrsmz commented 3 years ago

looks like it fails to run npm install --legacy-peer-deps

haya14busa commented 3 years ago

It should be fixed by #72

smarti57 commented 2 years ago

So I just ran into a seemingly similar issue (very similar trace). Do we know if this has been fixed in the latest release?

--- Last few GCs ---> 20 21 [19:0x7f59ca327330] 204359 ms: Mark-sweep 2028.7 (2092.3) -> 2017.1 (2094.3) MB, 3426.6 / 9.8 ms (average mu = 0.283, current mu = 0.110) allocation failure scavenge might not succeed 22 [19:0x7f59ca327330] 209106 ms: Mark-sweep 2025.1 (2094.3) -> 2021.0 (2108.5) MB, 4580.1 / 9.8 ms (average mu = 0.157, current mu = 0.035) allocation failure scavenge might not succeed 23 24 25 <--- JS stacktrace ---> 26 27 FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory 28 Aborted (core dumped) 29 /entrypoint.sh: line 13: /github/workspace/node_modules/.bin/eslint: not found 30 /entrypoint.sh: line 28: /github/workspace/node_modules/.bin/eslint: not found 31 2021/11/12 16:39:50 [eslint] reported: https://github.com/gitglacier/peak-front/runs/4192186866 (conclusion=success)

Lancear commented 2 years ago

I ran into a similar issue and used the node_options to increase the memory limit for my package.json scripts. That is why I created a pull request #119 which allows you to set the node_options environment variable for eslint.

haya14busa commented 2 years ago

merged #119