JavaScript heap out of memory in angular 2 -
i using angular cli. please check cli info
@angular/cli: 1.2.1 node: 6.10.0 os: win32 x64 @angular/animations: 4.1.1 @angular/common: 4.0.0 @angular/compiler: 4.0.0 @angular/compiler-cli: 4.0.0 @angular/core: 4.0.0 @angular/forms: 4.0.0 @angular/http: 4.0.0 @angular/platform-browser: 4.0.0 @angular/platform-browser-dynamic: 4.0.0 @angular/router: 4.1.1 when use ng serve --aot iam gtteing following error.please !!
<--- last few gcs --->
893427 ms: mark-sweep 1344.1 (1434.3) -> 1339.9 (1434.3) mb, 925.7 / 0.0 ms [allocation failure] [gc in old space requested]. 894468 ms: mark-sweep 1339.9 (1434.3) -> 1339.9 (1434.3) mb, 1040.5 / 0.0 ms [allocation failure] [gc in old space requested]. 895402 ms: mark-sweep 1339.9 (1434.3) -> 1339.6 (1418.3) mb, 933.7 / 0.0 ms [last resort gc]. 896331 ms: mark-sweep 1339.6 (1418.3) -> 1339.8 (1418.3) mb, 928.1 / 0.0 ms [last resort gc].
<--- js stacktrace --->
==== js stack trace =========================================
security context: 000001af8a2cfb61 2: /* anonymous */ [c:\project_folder\node_modules\source-map\lib\source-node.js:100] [pc=0000016e99866533] (this=00000346870554e1 ,mapping=000003c18fdc93c9 ) 3: arguments adaptor frame: 3->1 4: innerarrayforeach(aka innerarrayforeach) [native array.j...
fatal error: call_and_retry_last allocation failed - javascript heap out of memory
try modify files , replace contents following: (in folder : node_modules\bin)
modify ng.cmd:
@if exist "%~dp0\node.exe" ( "%~dp0\node.exe" --max_old_space_size=5048 "%~dp0\..\angular-cli\bin\ng" %* ) else ( @setlocal @set pathext=%pathext:;.js;=;% node --max_old_space_size=5048 "%~dp0\..\angular-cli\bin\ng" %* ) modify ngc.cmd :
@if exist "%~dp0\node.exe" ( "%~dp0\node.exe" --max_old_space_size=5048 "%~dp0\..\@angular\compiler-cli\src\main.js" %* ) else ( @setlocal @set pathext=%pathext:;.js;=;% node --max_old_space_size=5048 "%~dp0\..\@angular\compiler-cli\src\main.js" %* )
Comments
Post a Comment