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

[BUG] FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory #7351

Closed
2 tasks done
melroy89 opened this issue Apr 7, 2024 · 1 comment
Closed
2 tasks done
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x

Comments

@melroy89
Copy link

melroy89 commented Apr 7, 2024

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

I'm working on an Angular v17 frontend project with npm (package.json and package-lock.json).

When I run npm update using version 10.5.1 of npm it's busy updating and then it crashes with:

(⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ idealTree:erp-frontend: sill idealTree buildDeps
<--- Last few GCs --->

[101032:0x6501150]    22500 ms: Mark-Compact (reduce) 2047.2 (2082.3) -> 2046.7 (2083.0) MB, 17.50 / 0.02 ms  (+ 213.1 ms in 153 steps since start of marking, biggest step 9.1 ms, walltime since start of marking 348 ms) (average mu = 0.756, current mu = 0[101032:0x6501150]    22850 ms: Mark-Compact (reduce) 2047.7 (2083.0) -> 2047.7 (2084.0) MB, 345.21 / 0.00 ms  (average mu = 0.479, current mu = 0.014) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 0xb84bd6 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [npm update]
 2: 0xefeb90 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [npm update]
 3: 0xefee77 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [npm update]
 4: 0x1110885  [npm update]
 5: 0x1128708 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [npm update]
 6: 0x10fe821 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [npm update]
 7: 0x10ff9b5 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [npm update]
 8: 0x10dc0d6 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [npm update]
 9: 0x10cdd04 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [npm update]
10: 0x10d04e6 v8::internal::FactoryBase<v8::internal::Factory>::NewRawOneByteString(int, v8::internal::AllocationType) [npm update]
11: 0x1241cb5 v8::internal::JsonParser<unsigned short>::MakeString(v8::internal::JsonString const&, v8::internal::Handle<v8::internal::String>) [npm update]
12: 0x1247ccd  [npm update]
13: 0x1249c39 v8::internal::JsonParser<unsigned short>::ParseJson(v8::internal::Handle<v8::internal::Object>) [npm update]
14: 0xf9086e v8::internal::Builtin_JsonParse(int, unsigned long*, v8::internal::Isolate*) [npm update]
15: 0x1971df6  [npm update]
Aborted (core dumped)

Expected Behavior

No heap limit or crash when using npm on the command line. I still have plenty of ram left.

Steps To Reproduce

  1. See attachment for my package-lock.json & package.json file:
    package-lock.json
    package.json

  2. Run: npm update

  3. Crash (heap limit)

For info, npm outdated shows:

Package                                  Current   Wanted   Latest  Location                                             Depended by
@angular-builders/jest                    17.0.2   17.0.3   17.0.3  node_modules/@angular-builders/jest                  tmp
@angular-devkit/build-angular             17.2.3   17.3.3   17.3.3  node_modules/@angular-devkit/build-angular           tmp
@angular-eslint/builder                   17.2.1   17.2.1   17.3.0  node_modules/@angular-eslint/builder                 tmp
@angular-eslint/eslint-plugin             17.2.1   17.2.1   17.3.0  node_modules/@angular-eslint/eslint-plugin           tmp
@angular-eslint/eslint-plugin-template    17.2.1   17.2.1   17.3.0  node_modules/@angular-eslint/eslint-plugin-template  tmp
@angular-eslint/schematics                17.2.1   17.2.1   17.3.0  node_modules/@angular-eslint/schematics              tmp
@angular-eslint/template-parser           17.2.1   17.2.1   17.3.0  node_modules/@angular-eslint/template-parser         tmp
@angular/animations                       17.2.4   17.3.3   17.3.3  node_modules/@angular/animations                     tmp
@angular/cdk                              17.2.2   17.3.3   17.3.3  node_modules/@angular/cdk                            tmp
@angular/cli                              17.2.3   17.3.3   17.3.3  node_modules/@angular/cli                            tmp
@angular/common                           17.2.4   17.3.3   17.3.3  node_modules/@angular/common                         tmp
@angular/compiler                         17.2.4   17.3.3   17.3.3  node_modules/@angular/compiler                       tmp
@angular/compiler-cli                     17.2.4   17.3.3   17.3.3  node_modules/@angular/compiler-cli                   tmp
@angular/core                             17.2.4   17.3.3   17.3.3  node_modules/@angular/core                           tmp
@angular/forms                            17.2.4   17.3.3   17.3.3  node_modules/@angular/forms                          tmp
@angular/localize                         17.2.4   17.3.3   17.3.3  node_modules/@angular/localize                       tmp
@angular/material                         17.2.2   17.3.3   17.3.3  node_modules/@angular/material                       tmp
@angular/platform-browser                 17.2.4   17.3.3   17.3.3  node_modules/@angular/platform-browser               tmp
@angular/platform-browser-dynamic         17.2.4   17.3.3   17.3.3  node_modules/@angular/platform-browser-dynamic       tmp
@angular/router                           17.2.4   17.3.3   17.3.3  node_modules/@angular/router                         tmp
@types/node                             20.11.25  20.12.5  20.12.5  node_modules/@types/node                             tmp
@typescript-eslint/eslint-plugin          6.19.0   6.19.0    7.5.0  node_modules/@typescript-eslint/eslint-plugin        tmp
@typescript-eslint/parser                 6.19.0   6.19.0    7.5.0  node_modules/@typescript-eslint/parser               tmp
cypress                                   13.6.6   13.7.2   13.7.2  node_modules/cypress                                 tmp
eslint                                    8.57.0   8.57.0    9.0.0  node_modules/eslint                                  tmp
ngx-mat-select-search                      7.0.5    7.0.6    7.0.6  node_modules/ngx-mat-select-search                   tmp
typescript                                 5.3.3    5.3.3    5.4.4  node_modules/typescript                              tmp

Environment

  • npm: 10.5.1
  • Node.js: v20.12.1
  • OS Name: Linux Mint
  • System Model Name: Self-built
  • npm config:
; "user" config from /home/melroy/.npmrc

prefix = "/home/melroy/.npm-global" 

; node bin location = /usr/bin/node
; node version = v20.12.1
; npm local prefix = /media/melroy/Data/Projects/erp-frontend
; npm version = 10.5.1
; cwd = /media/melroy/Data/Projects/erp-frontend
; HOME = /home/melroy
; Run `npm config ls -l` to show all defaults.

Workaround

Not nice.. but the workaround for now is:

node --max-old-space-size=8000 $(which npm) update
@melroy89 melroy89 added Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x labels Apr 7, 2024
@wraithgar
Copy link
Member

Duplicate of #7276

@wraithgar wraithgar marked this as a duplicate of #7276 Apr 14, 2024
@wraithgar wraithgar closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x
Projects
None yet
Development

No branches or pull requests

2 participants