4

My Angular 2 app is generated by angular2-webpack-starter.

When I run command npm run build:aot to build AOT package, the console shows the following error message:

..... 92% chunk asset optimization

500690 ms: Mark-sweep 1290.1 (1421.8) -> 1290.1 (1437.8) MB, 1219.8 / 0.0 ms [allocation failure] [GC in old space requested]. 501898 ms: Mark-sweep 1290.1 (1437.8) -> 1290.1 (1437.8) MB, 1207.9 / 0.0 ms [allocation failure] [GC in old space requested]. 503171 ms: Mark-sweep 1290.1 (1437.8) -> 1298.4 (1421.8) MB, 1272.9 / 0.0 ms [last resort gc]. 504540 ms: Mark-sweep 1298.4 (1421.8) -> 1306.8 (1421.8) MB, 1368.3 / 0.0 ms [last resort gc].


Security context: 0000002FDCDCFB61 2: enter [D:\Code\BIMS\node_modules\optimize-js\lib\index.js:~13] [pc=0000033281F0E5C5] (this=0000008415DEBED9 ,node=000003AAAC2EFB31 2 4: visit(aka visit) [D:\Code\BIMS\node_modules\estree-walker\dist\estree-walker.umd....

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory ......

I have followed this post to add --max-old-space-size=8192 option for Node.js, but it seems that there is no effect.

user7637745
  • 965
  • 2
  • 14
  • 27
Wang Zhengzhang
  • 163
  • 1
  • 3
  • 6
  • did you find a solution for this ? It seems to be impossible to resolve it for me now. – Vikram Oct 17 '17 at 06:14
  • Duplicate of https://stackoverflow.com/questions/46071399/javascript-heap-out-of-memory-in-angular-js-gulp-sourcemap-ngannonate-with-babel/57035956#57035956 – Mr. Droid Jul 15 '19 at 08:32

0 Answers0