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

JavaScript heap out of memory #70

Closed
1 of 5 tasks
vivekkr12 opened this issue Nov 1, 2019 · 11 comments
Closed
1 of 5 tasks

JavaScript heap out of memory #70

vivekkr12 opened this issue Nov 1, 2019 · 11 comments

Comments

@vivekkr12
Copy link

vivekkr12 commented Nov 1, 2019

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

@github-actions
Copy link
Contributor

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

@maxim-lobanov
Copy link
Contributor

Hi!
Is this issue still actual?

@vivekkr12
Copy link
Author

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

@kumarabhirup
Copy link

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

Please reopen...

@maxim-lobanov
Copy link
Contributor

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

@sidverma32
Copy link

@helloint
Copy link

helloint commented Jan 5, 2022

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.

@AbeerAhmad
Copy link

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

@fisprak
Copy link

fisprak commented Jul 21, 2022

@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

mmichaelis added a commit to CoreMedia/ckeditor-plugins that referenced this issue Mar 3, 2023
Received

```
Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
```

while running pnpm lint as part of `pre-release.yml`.

According to

* actions/runner-images#70

increasing node memory should do the trick.
alegri90 added a commit to fortytwoservices/blog that referenced this issue Mar 7, 2023
the compiler seems to hit a heap limit / threshold and breaks the build. Hoping this solves it.
ref.: actions/runner-images#70
steve-fenton-octopus added a commit to OctopusDeploy/docs that referenced this issue Jul 17, 2023
@JoshMcCullough
Copy link

@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

So the documented option --max-old-space-size works as well as this undocumented snake_case version (--max_old_space_size)?

@dimaslanjaka
Copy link

in my dockerfile

# Set environment variable
ENV NODE_OPTIONS="--max_old_space_size=4096"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants