Hello,
I am facing a problem on ng build --prod , the error is in the following, any solution?
92% chunk asset optimization TerserPlugin <--- Last few GCs --->
[15616:000002217CD8AFF0] 233725 ms: Mark-sweep 1282.4 (1455.6) -> 1282.4 (1451.6) MB, 1375.6 / 0.0 ms (average mu = 0.143, current mu = 0.121) allocation failure GC in old space requested [15616:000002217CD8AFF0] 234498 ms: Mark-sweep 1282.4 (1451.6) -> 1282.1 (1449.6) MB, 772.8 / 0.0 ms (average mu = 0.091, current mu = 0.000) allocation failure GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 00000365CE55C5C1]
Security context: 0x0144a739e6e9 <JSObject> 1: _send [0000025C61359641] [internal/child_process.js:724] [bytecode=000001CD49E76731 offset=607](this=0x00150ab88899 <ChildProcess map = 0000032A7F4FB1A9>,message=0x00150ab88b01 <Object map = 0000032A7F4FC909>,handle=0x00e413b026f1 <undefined>,options=0x00150ab88879 <Object map = 0000032A7F4FD9E1>,callback=0x00e413b026f1 <undefined>) 2: send [000...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 1: 00007FF6050BF04A v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+5114 2: 00007FF60509A0C6 node::MakeCallback+4518 3: 00007FF60509AA30 node_module_register+2032 4: 00007FF6053220EE v8::internal::FatalProcessOutOfMemory+846 5: 00007FF60532201F v8::internal::FatalProcessOutOfMemory+639 6: 00007FF605842BC4 v8::internal::Heap::MaxHeapGrowingFactor+9556 7: 00007FF605839C46 v8::internal::ScavengeJob::operator=+24310 8: 00007FF60583829C v8::internal::ScavengeJob::operator=+17740 9: 00007FF605837765 v8::internal::ScavengeJob::operator=+14869 10: 00007FF605841064 v8::internal::Heap::MaxHeapGrowingFactor+2548 11: 00007FF6053FCA3B v8::internal::Factory::AllocateRawWithImmortalMap+59 12: 00007FF6053FF4ED v8::internal::Factory::NewRawTwoByteString+77 13: 00007FF605609AA8 v8::internal::Smi::SmiPrint+536 14: 00007FF60531582B v8::internal::StringHasher::UpdateIndex+219 15: 00007FF60533AB26 v8::String::Utf8Length+22 16: 00007FF604FF18B7 v8::internal::LookupIterator::index+37719 17: 00007FF604FEDAF3 v8::internal::LookupIterator::index+21907 18: 00007FF604FEA49A v8::internal::LookupIterator::index+7994 19: 00007FF60589C122 v8::internal::OptimizingCompileDispatcher::Unblock+59890 20: 00007FF60589D5AD v8::internal::OptimizingCompileDispatcher::Unblock+65149 21: 00007FF60589C606 v8::internal::OptimizingCompileDispatcher::Unblock+61142 22: 00007FF60589C4EB v8::internal::OptimizingCompileDispatcher::Unblock+60859 23: 00000365CE55C5C1
Thanks
3 Answer(s)
-
0
Hi,
Increasing the memory used by node might help, see https://github.com/angular/angular-cli/issues/5618#issuecomment-449624730
-
0
Hi,
I tried to add the following to package.json but did not resolver the issue.
"scripts": { "ng": "ng", "build-prod": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --prod", "publish": "ng build --prod", "start": "ng serve --host 0.0.0.0 --port 4200", "hmr": "ng serve --host 0.0.0.0 --port 4200 --hmr", "test": "ng test", "pree2e": "webdriver-manager update --standalone false --gecko false", "e2e": "protractor" },
** Error:** 13% building 27/36 modules 9 active ...gular\src\app\shared\layout\layout.less <--- Last few GCs --->
[1924:000002A3DD1DD150] 50357 ms: Mark-sweep 2021.0 (2077.4) -> 2011.1 (2081.1) MB, 415.4 / 0.0 ms (average mu = 0.306, current mu = 0.244) allocation failure scavenge might not succeed [1924:000002A3DD1DD150] 51308 ms: Mark-sweep 2024.2 (2081.6) -> 2013.9 (2081.9) MB, 779.5 / 0.0 ms (average mu = 0.235, current mu = 0.180) allocation failure scavenge might not succeed
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 00007FF61DF1170D]
Security context: 0x0132c7000911 <JSObject> 1: writeSpace(aka writeSpace) [000003B6954459B9] [D:\Source Code\Soffa\angular\node_modules\typescript\lib\typescript.js:~84320] [pc=0000012C3E4798DD](this=0x021a929404d1 <undefined>) 2: emitNodeList(aka emitNodeList) [000003B6954456F9] [D:\Source Code\Soffa\angular\node_modules\typescript\lib\typescript.js:~84147] [pc=0000012C3E47B1FE](this=0x021a...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Writing Node.js report to file: report.20190722.091250.1924.0.001.json Node.js report completed 1: 00007FF61D6D962F napi_wrap+122319 2: 00007FF61D682376 public: bool __cdecl v8::base::CPU::has_sse(void)const __ptr64+34454 3: 00007FF61D683036 public: bool __cdecl v8::base::CPU::has_sse(void)const __ptr64+37718 4: 00007FF61DE68A1E private: void __cdecl v8::Isolate::ReportExternalAllocationLimitReached(void) __ptr64+94 5: 00007FF61DE50D6A public: class v8::SharedArrayBuffer::Contents __cdecl v8::SharedArrayBuffer::Externalize(void) __ptr64+842 6: 00007FF61DCE256C public: static void __cdecl v8::internal::Heap::EphemeronKeyWriteBarrierFromCode(unsigned __int64,unsigned __int64,class v8::internal::Isolate * __ptr64)+1436 7: 00007FF61DCEA48F public: unsigned __int64 __cdecl v8::internal::Heap::OldGenerationSizeOfObjects(void) __ptr64+4879 8: 00007FF61DCE0733 public: bool __cdecl v8::internal::Heap::CollectGarbage(enum v8::internal::AllocationSpace,enum v8::internal::GarbageCollectionReason,enum v8::GCCallbackFlags) __ptr64+1235 9: 00007FF61DCDEFC4 public: void __cdecl v8::internal::Heap::AddRetainedMap(class v8::internal::Handle<class v8::internal::Map>) __ptr64+2292 10: 00007FF61DCFDAA5 public: class v8::internal::Handle<class v8::internal::HeapObject> __cdecl v8::internal::Factory::NewFillerObject(int,bool,enum v8::internal::AllocationType) __ptr64+53 11: 00007FF61DAB3E0D ??4iterator@JumpTableTargetOffsets@interpreter@internal@v8@@QEAAAEAV01234@$$QEAV01234@@Z+3757 12: 00007FF61DF1170D public: virtual bool __cdecl v8::internal::SetupIsolateDelegate::SetupHeap(class v8::internal::Heap * __ptr64) __ptr64+614605 13: 0000012C3E4798DD
-
0
Run
npm run ng-high-memory -- build --prod