Skip to content

Out of memory error when building with AOT #3651

Closed
@pleerock

Description

@pleerock

When I run ng build --prod --aot

it goes fine until 40%, then it becomes slow, and once it gets to 64% it stucks. It stucks for ~10 minutes and throws exception:

 2649/2791 modules 142 active ...de_modules/socket.io-client/lib/on.js                                                                                                                           
<--- Last few GCs --->

  834523 ms: Mark-sweep 1346.7 (1433.1) -> 1346.6 (1435.1) MB, 913.7 / 0.0 ms [allocation failure] [GC in old space requested].
  835570 ms: Mark-sweep 1346.6 (1435.1) -> 1346.5 (1435.1) MB, 1047.1 / 0.0 ms [allocation failure] [GC in old space requested].
  836555 ms: Mark-sweep 1346.5 (1435.1) -> 1347.9 (1402.1) MB, 984.8 / 0.0 ms [last resort gc].
  837489 ms: Mark-sweep 1347.9 (1402.1) -> 1347.9 (1399.1) MB, 933.7 / 0.0 ms [last resort gc].


<--- JS stacktrace --->

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

Security context: 0x3a414ebcfb51 <JS Object>
    1: applyPluginsBailResult1 [/Users/pleerock/www/project/node_modules/tapable/lib/Tapable.js:~80] [pc=0x38e7e98874d4] (this=0x214e62096241 <a Parser with map 0x5828c3561c1>,name=0x3320359c0b99 <String[27]: evaluate FunctionExpression>,param=0x33c4cc2bf4c9 <a Node with map 0xf06457379f9>)
    2: evaluateExpression [/Users/pleerock/www/project/node_modules/webpack/lib/P...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/usr/local/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/usr/local/bin/node]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/node]
 4: v8::internal::Factory::NewFixedArray(int, v8::internal::PretenureFlag) [/usr/local/bin/node]
 5: v8::internal::HashTable<v8::internal::StringTable, v8::internal::StringTableShape, v8::internal::HashTableKey*>::EnsureCapacity(v8::internal::Handle<v8::internal::StringTable>, int, v8::internal::HashTableKey*, v8::internal::PretenureFlag) [/usr/local/bin/node]
 6: v8::internal::StringTable::LookupKey(v8::internal::Isolate*, v8::internal::HashTableKey*) [/usr/local/bin/node]
 7: v8::internal::StringTable::LookupString(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>) [/usr/local/bin/node]
 8: v8::internal::LookupIterator::LookupIterator(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Name>, v8::internal::LookupIterator::Configuration) [/usr/local/bin/node]
 9: v8::internal::LookupIterator::PropertyOrElement(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, bool*, v8::internal::LookupIterator::Configuration) [/usr/local/bin/node]
10: v8::internal::Runtime::GetObjectProperty(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>) [/usr/local/bin/node]
11: v8::internal::Runtime_KeyedGetProperty(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
12: 0x38e7e52092a7
13: 0x38e7e98874d4
Abort trap: 6

mac OSX El Capitan
angular-cli: 1.0.0-beta.22-1
node: 6.6.0

Looks like there is memory leak somewhere. We have a big project. 1500 typescript files and almost 100k lines of code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions