I cloned an expressjs api inside an Ubuntu 20.x server.
I try to run the following script: tsc && node build/app.js, but after a few seconds I get the following error:
<--- Last few GCs --->
[37431:0x4ba77f0] 23371 ms: Scavenge 482.9 (492.8) -> 482.5 (493.0) MB, 6.3 / 0.0 ms (average mu = 0.233, current mu = 0.195) allocation failure
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 1: 0xb09980 node::Abort() [node] 2: 0xa1c235 node::FatalError(char const*, char const*) [node] 3: 0xcf77be v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node] 4: 0xcf7b37 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node] 5: 0xeaf3d5 [node] 6: 0xeafeb6 [node] 7: 0xebe3de [node] 8: 0xebee20 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node] 9: 0xec1d15 v8::internal::Heap::HandleGCRequest() [node] 10: 0xe4f3b7 v8::internal::StackGuard::HandleInterrupts() [node] 11: 0x11fb775 v8::internal::Runtime_StackGuard(int, unsigned long*, v8::internal::Isolate*) [node] 12: 0x15f0a99 [node] Aborted (core dumped)
I have followed posts that say to increase the heap size which I did all the way up to 8GB by adding it to my node script node --max-old-space-size-8192 build/app.js, but that has not helped.
I am working with Node version 16.14.0 in Ubuntu 20.x server.