Reputation: 1409
After updates to node and npm I now get below error when running my webpack build via npm locally and have no clue what this means and how to proceed. Looks a bit like a garbage collection memory issue?
<--- Last few GCs --->
[13532:000001831E41C3E0] 99499 ms: Mark-sweep 2047.4 (2049.9) -> 2046.7 (2050.1) MB, 1711.8 / 0.0 ms (average mu = 0.164, current mu = 0.008) allocation failure scavenge might not succeed
[13532:000001831E41C3E0] 100918 ms: Mark-sweep 2047.7 (2050.1) -> 2047.0 (2050.4) MB, 1313.4 / 0.0 ms (+ 54.5 ms in 14 steps since start of marking, biggest step 52.2 ms, walltime since start of marking 1419 ms) (average mu = 0.104, current mu = 0.036)
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 00007FF6F1866C4D]
Security context: 0x01fcc6d008d1 <JSObject>
1: scan [0000023873A87471] [E:\privat\3dm2\node_modules\typescript\lib\typescript.js:~9332] [pc=00000395F8CCB228](this=0x023873a87a31 <Object map = 00000042A8CCCCD9>)
2: parsePrimaryExpression(aka parsePrimaryExpression) [0000023873A84C41] [E:\privat\3dm2\node_modules\typescript\lib\typescript.js:~22792] [pc=00000395F8E1F3AA](this=0x01fed85c04b1
<u...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Writing Node.js report to file: report.20200501.233208.13532.0.001.json
Node.js report completed
1: 00007FF6F0C5D1EF napi_wrap+113103
2: 00007FF6F0BFCA66 public: bool __cdecl v8::base::CPU::has_sse(void)const __ptr64+64982
3: 00007FF6F0BFD8F3 public: bool __cdecl v8::base::CPU::has_sse(void)const __ptr64+68707
4: 00007FF6F1419BBE private: void __cdecl v8::Isolate::ReportExternalAllocationLimitReached(void) __ptr64+94
5: 00007FF6F1401C91 public: class v8::SharedArrayBuffer::Contents __cdecl v8::SharedArrayBuffer::Externalize(void) __ptr64+833
6: 00007FF6F12CE1EC public: static void __cdecl v8::internal::Heap::EphemeronKeyWriteBarrierFromCode(unsigned __int64,unsigned __int64,class v8::internal::Isolate * __ptr64)+1436
7: 00007FF6F12D9420 public: void __cdecl v8::internal::Heap::ProtectUnprotectedMemoryChunks(void) __ptr64+1312
8: 00007FF6F12D5F44 public: static bool __cdecl v8::internal::Heap::PageFlagsAreConsistent(class v8::internal::HeapObject)+3204
9: 00007FF6F12CB743 public: bool __cdecl v8::internal::Heap::CollectGarbage(enum v8::internal::AllocationSpace,enum v8::internal::GarbageCollectionReason,enum v8::GCCallbackFlags) __ptr64+1283
10: 00007FF6F12C9DB4 public: void __cdecl v8::internal::Heap::AddRetainedMap(class v8::internal::Handle<class v8::internal::Map>) __ptr64+2452
11: 00007FF6F12EAFBD public: class v8::internal::Handle<class v8::internal::HeapObject> __cdecl v8::internal::Factory::NewFillerObject(int,bool,enum v8::internal::AllocationType,enum v8::internal::AllocationOrigin) __ptr64+61
12: 00007FF6F10516FF public: class v8::internal::interpreter::JumpTableTargetOffsets::iterator & __ptr64 __cdecl v8::internal::interpreter::JumpTableTargetOffsets::iterator::operator=(class v8::internal::interpreter::JumpTableTargetOffsets::iterator && __ptr64) __ptr64+1295
13: 00007FF6F1866C4D public: virtual bool __cdecl v8::internal::SetupIsolateDelegate::SetupHeap(class v8::internal::Heap * __ptr64) __ptr64+546637
14: 00000395F8CCB228
npm ERR! code ELIFECYCLE
npm ERR! errno 134
What I find particularly strange is that when building this via Gitlab with a .gitlab-ci.yml starting like below it all works fine. Also ensured npm version is the same local as in docker container but still get a working docker build but a failed local one...
build_package:
image: node:12.16.3
script:
- npm -g install [email protected]
- npm --version
Anybody any ideas?
Upvotes: 0
Views: 400
Reputation: 12552
You can see the error:
JavaScript heap out of memory
You can add an Environmental variable:
export NODE_OPTIONS="--max_old_space_size=4096"
Then run your webpack. If it fails increase the size.
Upvotes: 1