a year ago
I'm trying to deploy a MedusaJS backend using the Trial Plan and receive the following error:
[info] [webpackbar] Compiling Webpack
<--- Last few GCs --->
[7:0x37b47a0] 26196 ms: Scavenge (reduce) 244.5 (257.0) -> 244.3 (257.5) MB, 1.5 / 0.0 ms (average mu = 0.272, current mu = 0.158) allocation failure;
[7:0x37b47a0] 26201 ms: Scavenge (reduce) 244.9 (257.5) -> 244.6 (258.0) MB, 1.5 / 0.0 ms (average mu = 0.272, current mu = 0.158) allocation failure;
[7:0x37b47a0] 26385 ms: Mark-sweep (reduce) 245.3 (258.0) -> 242.6 (258.0) MB, 181.1 / 0.0 ms (average mu = 0.345, current mu = 0.431) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xab4728 node::Abort() [node]
2: 0x9a4839 [node]
3: 0xcc23e0 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, bool) [node]
4: 0xcc27ab v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, bool) [node]
5: 0xea6cc5 [node]
6: 0xea6d9b [node]
7: 0xeba18a v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const, v8::GCCallbackFlags) [node] 8: 0xebafa5 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node] 9: 0xe9789a v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node] 10: 0xe98c44 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node] 11: 0xe7934d v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node] 12: 0x12616eb v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long, v8::internal::Isolate*) [node]
13: 0x16abdf9 [node]
I deployed the PostgresDB externally to have more memory available but the problem continue.
Also, I tried setting the NODE_OPTIONS = --max-old-space-size=8192 and it still crashes but this time I can't see the problem in the log.
Any help is welcomed.
1 Replies
a year ago
Each service on the trial plan gets 512mb of memory, and from your logs, your app is trying to use more than that and crashing, you would need to upgrade to hobby for access to 8gb of memory per service.