Im getting this error when i run ng build --prod
92% chunk asset optimization <--- Last few GCs --->
[4136:0155D210] 443646 ms: Mark-sweep 703.5 (770.3) -> 703.6 (759.8) MB, 2162.2 / 0.0 ms (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 2163 ms) last resort GC in old space requested [4136:0155D210] 445794 ms: Mark-sweep 703.6 (759.8) -> 703.5 (759.8) MB, 2147.8 / 0.0 ms last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0369632D 1: create(this=036856A9 ) 2: _walk [034841A1 :~764] [pc=1CCAED1F](this=3A11A619 ,visitor=3BCEFD7D ) 3: /* anonymous */ [034841A1 :~969] [pc=1D3728E3](this=3A11BCBD ) 4: _walk [034841A1 :~968] [pc=1CCC1F3B](this=3A11BCBD
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 1: node_module_register 2: v8::internal::Factory::NewStruct 3: v8::internal::Factory::NewPrototypeInfo
I tried everything. I reduced the usage of variables and checked for memory leaks and made very less callbacks in the ts file.
Im unable to figure out how to do it. I tried increasing the node memory by using 'npm i increase-memory-limit' and increased the limit to 2GB.
Im using angular 4. Node version is 8.9.4