Angular – allocation failure scavenge might not succeed

Application stack: Backend - Node, Frontend - Angular

Hosted on free tier AWS ec2 which was working fine, but now it is exceeding memory on compilation, and it returns this error:

<--- Last few GCs --->
[4036:000001A5416B67F0]    33037 ms: Mark-sweep 397.5 (404.1) -> 396.1 (404.1) MB, 569.9 / 0.0 ms  
(average mu = 0.151, current mu = 0.019) allocation failure scavenge might not succeed
[4036:000001A5416B67F0]    33621 ms: Mark-sweep 398.3 (408.3) -> 396.5 (408.5) MB, 424.9 / 0.0 ms  
(average mu = 0.212, current mu = 0.272) allocation failure scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 00007FF64697058F napi_wrap+109311
2: 00007FF6469152B6 v8::internal::OrderedHashTable<v8::internal::OrderedHashSet,1>::NumberOfElementsOffset+33302
3: 00007FF646916086 node::OnFatalError+294
4: 00007FF6471E153E v8::Isolate::ReportExternalAllocationLimitReached+94
5: 00007FF6471C63BD v8::SharedArrayBuffer::Externalize+781
6: 00007FF64707084C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1516
7: 00007FF64707BB8A v8::internal::Heap::ProtectUnprotectedMemoryChunks+1258
8: 00007FF647078D39 v8::internal::Heap::PageFlagsAreConsistent+2457
9: 00007FF64706D961 v8::internal::Heap::CollectGarbage+2033
10: 00007FF64706BB65 v8::internal::Heap::AllocateExternalBackingStore+1317
11: 00007FF64708BF57 v8::internal::Factory::NewFillerObject+183
12: 00007FF646DBBFB1 v8::internal::interpreter::JumpTableTargetOffsets::iterator::operator=+1409
13: 00007FF647269EED v8::internal::SetupIsolateDelegate::SetupHeap+463949
14: 00000002F40BB562

I understand the issue and now I want to upgrade the instance from the free tier, but what I cannot find is how to check the memory required by my node app, so I can upgrade the instance accordingly.

Is there a way to do this calculation?



Read more here: https://stackoverflow.com/questions/66273316/angular-allocation-failure-scavenge-might-not-succeed

Content Attribution

This content was originally published by Huzaifa at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: