FATAL ERROR: MarkCompactCollector: semi-space copy, fallback in old gen Allocation failed - JavaScript heap out of memory

Hello ,

I have an error, please can you help me

<— Last few GCs —>

[6226:0x3452e40] 49941 ms: Mark-sweep 2031.0 (2085.0) -> 2030.8 (2087.8) MB, 33.9 / 0.0 ms (average mu = 0.926, current mu = 0.414) allocation failure scavenge might not succeed
[6226:0x3452e40] 49982 ms: Mark-sweep 2033.7 (2087.8) -> 2033.3 (2096.0) MB, 34.9 / 0.0 ms (average mu = 0.851, current mu = 0.150) allocation failure scavenge might not succeed

<— JS stacktrace —>
Cannot get stack trace in GC.
FATAL ERROR: MarkCompactCollector: semi-space copy, fallback in old gen Allocation failed - JavaScript heap out of memory
1: 0xa18150 node::Abort() [/usr/local/bin/node]
2: 0xa1855c node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
3: 0xb9715e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
4: 0xb974d9 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
5: 0xd54755 [/usr/local/bin/node]
6: 0xd83aaa v8::internal::EvacuateNewSpaceVisitor::Visit(v8::internal::HeapObject, int) [/usr/local/bin/node]
7: 0xd8af60 void v8::internal::LiveObjectVisitor::VisitBlackObjectsNoFail<v8::internal::EvacuateNewSpaceVisitor, v8::internal::MajorNonAtomicMarkingState>(v8::internal::MemoryChunk*, v8::internal::MajorNonAtomicMarkingState*, v8::internal::EvacuateNewSpaceVisitor*, v8::internal::LiveObjectVisitor::IterationMode) [/usr/local/bin/node]
8: 0xd9a368 v8::internal::FullEvacuator::RawEvacuatePage(v8::internal::MemoryChunk*, long*) [/usr/local/bin/node]
9: 0xd7cdae v8::internal::Evacuator::EvacuatePage(v8::internal::MemoryChunk*) [/usr/local/bin/node]
10: 0xd7d074 v8::internal::PageEvacuationTask::RunInParallel(v8::internal::ItemParallelJob::Task::Runner) [/usr/local/bin/node]
11: 0xd72355 v8::internal::ItemParallelJob::Task::RunInternal() [/usr/local/bin/node]
12: 0xd72764 v8::internal::ItemParallelJob::Run() [/usr/local/bin/node]
13: 0xd8c417 void v8::internal::MarkCompactCollectorBase::CreateAndExecuteEvacuationTasks<v8::internal::FullEvacuator, v8::internal::MarkCompactCollector>(v8::internal::MarkCompactCollector*, v8::internal::ItemParallelJob*, v8::internal::MigrationObserver*, long) [/usr/local/bin/node]
14: 0xd9c944 v8::internal::MarkCompactCollector::EvacuatePagesInParallel() [/usr/local/bin/node]
15: 0xd9d55a [/usr/local/bin/node]
16: 0xda27d7 v8::internal::MarkCompactCollector::CollectGarbage() [/usr/local/bin/node]
17: 0xd60d09 v8::internal::Heap::MarkCompact() [/usr/local/bin/node]
18: 0xd61a23 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]
19: 0xd62555 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
20: 0xd6500c v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
21: 0xd32eac v8::internal::factory::NewRawOneByteString(int, v8::internal::AllocationType) [/usr/local/bin/node]
22: 0x1102595 v8::internal::IncrementalStringBuilder::Extend() [/usr/local/bin/node]
23: 0xe49248 v8::internal::JsonStringifier::SerializeString(v8::internal::Handlev8::internal::String) [/usr/local/bin/node]
24: 0xe4a9a1 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/local/bin/node]
25: 0xe4c508 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/local/bin/node]
26: 0xe4c508 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/local/bin/node]
27: 0xe4eeb6 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/local/bin/node]
28: 0xe4ebbf v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/local/bin/node]
29: 0xe4c8c7 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/local/bin/node]
30: 0xe4c508 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/local/bin/node]
31: 0xe4eeb6 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/local/bin/node]
32: 0xe4c8c7 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/local/bin/node]
33: 0xe4c508 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/local/bin/node]
34: 0xe4eeb6 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/local/bin/node]
35: 0xe4f864 v8::internal::JsonStringify(v8::internal::Isolate*, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object) [/usr/local/bin/node]
36: 0xc488eb v8::internal::Builtin_JsonStringify(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
37: 0x140a9f9 [/usr/local/bin/node]

One of the lines says “FatalProcessOutOfMemory” so I guess the process did maybe run out of memory.

I saw that it is necessary to increase the memory,
node --max-old-space-size = 8192 xxxx.js
but i don’t know which n8n file i should use

You should be able to set it as an environment variable:

NODE_OPTIONS="--max-old-space-size=1536"