Skip to content

error while running build (npm start/ng test) - JavaScript heap out of memory exception (intermittent ) #20822

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

Closed
12 tasks
amitagt007 opened this issue May 17, 2021 · 2 comments

Comments

@amitagt007
Copy link

amitagt007 commented May 17, 2021

🐞 Bug report

Command (mark with an x)

  • new
  • [x ] build
  • [x ] serve
  • [ x] test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Description

updated from angular 10 to 12 version. after that while running ng serve . ng test getting below error-

'FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory'

🔬 Minimal Reproduction

run npm start / ng test, getting the exception and build not successful. modified node config, still intermittently its coming

package config -
"scripts": {
"ng": "ng",
"start": "node --max_old_space_size=3000000 ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --disable-host-check",
"build": "node --max_old_space_size=3000000 ./node_modules/@angular/cli/bin/ng build",
"test": "node --max_old_space_size=3000000 ./node_modules/@angular/cli/bin/ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"prettier-check": "npx prettier --check ."
},

🔥 Exception or Error


⠋ Generating browser application bundles (phase: sealing)...
<--- Last few GCs --->

[39208:0081C0A0]   200939 ms: Scavenge (reduce) 1004.7 (1021.9) -> 1003.9 (1022.9) MB, 2.9 / 0.0 ms  (average mu = 0.256, current mu = 0.179) allocation failure 
[39208:0081C0A0]   200979 ms: Scavenge (reduce) 1006.3 (1026.4) -> 1005.6 (1026.4) MB, 18.9 / 0.0 ms  (average mu = 0.256, current mu = 0.179) allocation failure 
[39208:0081C0A0]   201011 ms: Scavenge (reduce) 1008.1 (1025.1) -> 1007.5 (1026.1) MB, 9.5 / 0.0 ms  (average mu = 0.256, current mu = 0.179) allocation failure 


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 01268689 v8::internal::Heap::PageFlagsAreConsistent+2169
 2: 0125E701 v8::internal::Heap::CollectGarbage+1985
 3: 0125CDB3 v8::internal::Heap::AllocateExternalBackingStore+1171


🌍 Your Environment


Angular - 12.0.0
Node -  v14.17.0
npm - 7.13.0


image

Anything else relevant?

@alan-agius4
Copy link
Collaborator

Duplicate of #20801

@alan-agius4 alan-agius4 marked this as a duplicate of #20801 May 17, 2021
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants