While Running Angular 2 AOT rollup I have faced above issue
<--- Last few GCs --->
144518 ms: Mark-sweep 1317.0 (1404.4) -> 1317.0 (1404.4) MB, 1522
Tried almost all the options but no luck,
JUST increased Virtual memory and it worked :-)
Permanent fix(Commands are for Windows :
For Compilation:
node --max-old-space-size=8192 node_modules/@angular/compiler-cli/src/main.js -p tsconfig-aot.json
For Rollup:
node --max-old-space-size=8192 node_modules/rollup/bin/rollup -c rollup-config.js