question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Building aio predocs produces JavaScript heap out of memory

See original GitHub issue

Docs or angular.io Bug Report

Description

When doing aio build specifically in the predocs part in the generate-stackblitz step after a long time the build fails with FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory

Minimal Reproduction

Just try to build aio

What’s the affected URL?**

https://github.com/angular/angular/tree/master/aio

Reproduction Steps**

Try to build aio or just run npm run predocsor npm run generate-stackblitz

Expected vs Actual Behavior**

the expected behavior is and actual behavior is

Screenshot

Screenshot

Exception or Error


$ node ./tools/stackblitz-builder/generateStackblitz

<--- Last few GCs --->

[22369:0x1048f3000]  7381236 ms: Mark-sweep (reduce) 8161.4 (8214.7) -> 8160.6 (8214.7) MB, 33663.6 / 0.0 ms  (average mu = 0.096, current mu = 0.000) allocation failure scavenge might not succeed
[22369:0x1048f3000]  7400495 ms: Mark-sweep (reduce) 8161.6 (8211.7) -> 8161.3 (8213.4) MB, 19249.3 / 0.0 ms  (average mu = 0.061, current mu = 0.001) allocation failure scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x10130d6e5 node::Abort() (.cold.1) [/Users/antoniocardenas/.nvm/versions/node/v14.17.0/bin/node]
 2: 0x1000b1c49 node::Abort() [/Users/antoniocardenas/.nvm/versions/node/v14.17.0/bin/node]
 3: 0x1000b1daf node::OnFatalError(char const*, char const*) [/Users/antoniocardenas/.nvm/versions/node/v14.17.0/bin/node]
 4: 0x1001f60f7 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/Users/antoniocardenas/.nvm/versions/node/v14.17.0/bin/node]
 5: 0x1001f6093 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/antoniocardenas/.nvm/versions/node/v14.17.0/bin/node]
 6: 0x1003a54f5 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/antoniocardenas/.nvm/versions/node/v14.17.0/bin/node]
 7: 0x1003a6fba v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/Users/antoniocardenas/.nvm/versions/node/v14.17.0/bin/node]
 8: 0x1003a2689 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/Users/antoniocardenas/.nvm/versions/node/v14.17.0/bin/node]
 9: 0x10039ff21 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/antoniocardenas/.nvm/versions/node/v14.17.0/bin/node]
10: 0x1003ae7da v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/antoniocardenas/.nvm/versions/node/v14.17.0/bin/node]
11: 0x1003ae861 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/antoniocardenas/.nvm/versions/node/v14.17.0/bin/node]
12: 0x10037bf12 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/antoniocardenas/.nvm/versions/node/v14.17.0/bin/node]
13: 0x1006fc158 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/antoniocardenas/.nvm/versions/node/v14.17.0/bin/node]
14: 0x100a893d9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/Users/antoniocardenas/.nvm/versions/node/v14.17.0/bin/node]
error Command failed with signal "SIGABRT".

Your Environment

Angular CLI: 12.0.4 Node: 14.17.0 Package Manager: yarn 1.22.10 OS: Darwin x64

Browser info

Anything else relevant?

I tried to fix it using node --max_old_space_size=X in node ./tools/stackblitz-builder/generateStackblitz But it does not work . I used as a reference this commit https://github.com/angular/angular/commit/1e740581ee3da305014b5dd2fec3fce79fb2d025

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
gkalpakcommented, Jul 2, 2021

As a sidenote, the docs in aio/aio-builds-setup/docs/ are related to a different thing (the preview server) and should not be needed for building AIO locally. (Of course, the instructions for setting up docker are similar if that’s what you want to do, but the bulk of docs in that directory are specific to the preview server, which is completely independent of the rest of AIO.)

If you are looking for a Dockerfile for working with the Angular repo in docker, you would be better off using .devcontainer/recommended-Dockerfile.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix JavaScript Heap Out of Memory Error - MakeUseOf
js project is the “JavaScript heap out of memory” error. This error usually occurs when the default memory allocated by your system to...
Read more >
JavaScript Heap Out Of Memory Error - OpenReplay Blog
A quick solution that you can use to fix "Heap Out Of Memory Error" in JavaScript. We lay out the causes and how...
Read more >
Node.js Heap out of Memory at build time - Stack Overflow
The build of my React app fails with a (after two days of trials) horrendous 'JavaScript heap out of memory'.
Read more >
Intermittent JavaScript heap out of memory error ... - Reddit
Since this error happens both when the build runs on an Azure DevOps build agent (which is single use) and on local machines, ......
Read more >
ng serve fatal error: ineffective mark-compacts near heap limit ...
node_modules/@angular/cli/bin/ng build --configuration=prod", }. After that: npm run ng-high-memory. Url: JavaScript heap out of memory. Open side panel.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found