Skip to content

AoT - Allocation failed - JavaScript heap out of memory Even with Beta 20-4 #3163

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
naveedahmed1 opened this issue Nov 16, 2016 · 3 comments

Comments

@naveedahmed1
Copy link

When I compile my project which uses lazyloading using latest version of angular cli (ng build --prod --aot) it fails with "JavaScript heap out of memory " error..

I am using:

angular-cli: 1.0.0-beta.20-4
node: 6.9.1
os: win32 x64

Below is the log:

D:\MyProject>ng build --prod --aot
312982ms building modules
508ms sealing
16ms optimizing
1ms basic module optimization
299ms module optimization
5468ms advanced module optimization
136ms basic chunk optimization
0ms chunk optimization
21ms advanced chunk optimization
455ms building modules
1ms module and chunk tree optimization
1050ms module reviving
18ms module order optimization
48ms module id optimization
10ms chunk reviving
3ms chunk order optimization
44ms chunk id optimization
11288ms hashing
2ms module assets processing
1053ms chunk assets processing
9ms additional chunk assets processing
1ms recording
 91% additional asset processing
<--- Last few GCs --->

  680083 ms: Mark-sweep 1341.3 (1437.0) -> 1339.8 (1437.0) MB, 991.9 / 0.0 ms [allocation failure] [GC in old space requested].
  681044 ms: Mark-sweep 1339.8 (1437.0) -> 1339.8 (1437.0) MB, 960.9 / 0.0 ms [allocation failure] [GC in old space requested].
  682011 ms: Mark-sweep 1339.8 (1437.0) -> 1340.9 (1412.0) MB, 966.0 / 0.0 ms [last resort gc].
  682986 ms: Mark-sweep 1340.9 (1412.0) -> 1342.1 (1412.0) MB, 974.9 / 0.0 ms [last resort gc].


<--- JS stacktrace --->

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

Security context: 0000019861ECFB61 <JS Object>
    1: /* anonymous */ [D:\MyProject\node_modules\webpack-sources\node_modules\source-map\lib\source-map-consumer.js:~142] [pc=000000411A16D6AE] (this=00000294368EDB49 <a BasicSourceMapConsumer with map 000003BC1D766499>,mapping=0000039E0356A939 <a Mapping with map 000003BC1D766C29>)
    2: arguments adaptor frame: 3->1
    3: map [native array.js:~994] [pc=000000411A15B70C] (thi...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
@slmyers
Copy link

slmyers commented Nov 18, 2016

You can try running the process with more memory. I've had to do similar for my app w/ ng serve.

"node --max-old-space-size=X <path to ng> serve"
"node --max-old-space-size=4076 ~/.yarn-config/global/node_modules/angular-cli/bin/ng serve"

@naveedahmed1
Copy link
Author

In my case the solution was #1652 (comment)

@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 Sep 6, 2019
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