JavaScript heap out of memory on Build Pipeline

If during the Build Pipeline you receive the following message:

<--- JS stacktrace --->  

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

----- Native stack trace -----  

1: 0x561a53ff9258 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]  
2: 0x561a543de044 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]  
3: 0x561a543de42b v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]  
4: 0x561a546098ab [node]  
5: 0x561a5461fa1e [node]  
6: 0x561a545f97e6 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]  
7: 0x561a545fabeb v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]  
8: 0x561a545d9bc2 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]  
9: 0x561a54a0e331 v8::internal::Runtime_AllocateInOldGeneration(int, unsigned long*, v8::internal::Isolate*) [node]  
10: 0x561a54e9e3f6 [node]  
Aborted (core dumped)

Most likely, it's because the container ran out of memory. In order to solve that, please declare the following environment variable on top:

export NODE_OPTIONS=--max_old_space_size=4096

If after that the issue continues, that is a hard limit and cannot be increased I'm afraid, however, you can certainly move the process to your own server, via an SSH Command.

Proudly powered by Katapult. Running on 100% renewable energy.