actions/runner-images

JavaScript heap out of memory

vivekkr12 opened this issue ยท 9 comments

Describe the bug
During build of a vue app using vue cli, nodejs 10x, build fails with the following error:
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Virtual environments affected

  • macOS 10.14
  • Ubuntu 16.04 LTS
  • Ubuntu 18.04 LTS
  • Windows Server 2016 R2
  • Windows Server 2019

Expected behavior
Build should run successfully.

Actual behavior
Build fails with the error mentioned above. Error logs
https://github.com/OutdoorRD/trails-viz/commit/b88b74b170ba77c4c0f4cbc817022f69e4b73e4c/checks?check_suite_id=290912535

This issue has not had any activity for 45 days and will be closed in 45 days if there continues to be no activity.

Hi!
Is this issue still actual?

Can be avoided by setting max heap size.
export NODE_OPTIONS="--max_old_space_size=4096"

I see the issue even after doing export NODE_OPTIONS="--max_old_space_size=4096"...

Please reopen...

@kumarabhirup , Initial issue was related to Node.js configuration rather image itself. If you think that your issue comes from something broken on image, feel free to create the new issue and provide minimal repro steps for the issue.

considering the Node.js document, should be --max-old-space-size=SIZE, but tested both max_old_space_size and max-old-space-size works.

Can be avoided by setting max heap size. export NODE_OPTIONS="--max_old_space_size=4096"
Where to put it in github actions?

@AbeerAhmad In run or env blocks.

run

jobs:
  make-love:
    steps:
      - name: "Just do it"
        run: |
        export NODE_OPTIONS="--max_old_space_size=4096"
        npm start

env

jobs:
  make-love:
    steps:
      - name: "Nothing is impossible"
        env:
          NODE_OPTIONS: "--max_old_space_size=4096"
        run: npm start