Skip to content

1.5.0 - cannot build with AOT or Build Optimizer: JavaScript heap out of memory #8334

Closed
@bniedermeyer

Description

@bniedermeyer

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
    
Angular CLI: 1.5.0
Node: 8.8.0
OS: linux x64
Angular: 4.4.6
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, tsc-wrapped

@angular/cdk: 2.0.0-beta.8
@angular/cli: 1.5.0
@angular/flex-layout: 2.0.0-beta.10
@angular/material: 2.0.0-beta.8
@angular-devkit/build-optimizer: 0.0.32
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0
@schematics/angular: 0.1.0
typescript: 2.3.4
webpack: 3.8.1

Repro steps.

rm -rf node_modules/
npm install --save-dev @angular/cli@latest
npm install
ng build --prod --aot --build-optimizer

The log given by the failure.

<--- Last few GCs --->

[2824:0x3fc7030]  1761516 ms: Mark-sweep 1415.7 (1628.1) -> 1415.7 (1628.1) MB, 569.0 / 0.0 ms  allocation failure scavenge might not succeed
[2824:0x3fc7030]  1762152 ms: Mark-sweep 1415.7 (1628.1) -> 1415.7 (1594.6) MB, 635.9 / 0.0 ms  last resort GC in old space requested
[2824:0x3fc7030]  1762801 ms: Mark-sweep 1415.7 (1594.6) -> 1415.7 (1582.1) MB, 648.6 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x93392d25e91 <JSObject>
    1: DoJoin(aka DoJoin) [native array.js:~95] [pc=0x2117503e8e39](this=0x16b6da402311 <undefined>,p=0x2730411704a9 <JSArray[832]>,q=832,E=0x16b6da4023b1 <true>,A=0x
93392d6e551 <String[1]:  >,z=0x16b6da402421 <false>)
    2: Join(aka Join) [native array.js:~120] [pc=0x21174f16e629](this=0x16b6da402311 <undefined>,p=0x2730411704a9 <JSArray[832]>,q=832,A=0x93392d6e551 <String[1]:  >,
z=0x16b6da4024...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [ng]
 2: 0x121809c [ng]
 3: v8::Utils::ReportOOMFailure(char const*, bool) [ng]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [ng]
 5: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [ng]
 6: v8::internal::Runtime_StringBuilderJoin(int, v8::internal::Object**, v8::internal::Isolate*) [ng]
 7: 0x21174ef8463d
[1]    2824 abort (core dumped)  ng build --prod  --aot --build-optimizer

Desired functionality.

After updating a project to CLI v1.5.0 builds with aot and build-optimizer should be successful

Mention any other details that might be useful.

I'm working with an existing medium to larger sized app and can build with AOT using cli v1.4.9. Using --build-optimizer failed with the same result as above so I tried updating my CLI to 1.5 to see if there were any improvements and can no longer build with AOT. The build will process for 15-20 minutes then crashes with the output above. At first I thought it could be related to devkit #240, but after running the build again with --build-optimizer=false the out of memory crash reoccurred. I am only able to successfully build by disabling aot and build-optimizer.

Metadata

Metadata

Assignees

Labels

P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfulseverity3: broken

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions