Chris Tsongas
01/04/2022, 5:57 PMts-node
processes for cron jobs or seeding the database, the app crashes apparently running out of memory:
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xb00d90 node::Abort() [/app/.heroku/node/bin/node]
2: 0xa1823b node::FatalError(char const*, char const*) [/app/.heroku/node/bin/node]
3: 0xcedbce v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/app/.heroku/node/bin/node]
4: 0xcedf47 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/app/.heroku/node/bin/node]
5: 0xea6105 [/app/.heroku/node/bin/node]
6: 0xea6be6 [/app/.heroku/node/bin/node]
7: 0xeb4b1e [/app/.heroku/node/bin/node]
8: 0xeb5560 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/app/.heroku/node/bin/node]
9: 0xeb84de v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/app/.heroku/node/bin/node]
10: 0xe7990a v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/app/.heroku/node/bin/node]
11: 0x11f2f06 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/app/.heroku/node/bin/node]
12: 0x15e7819 [/app/.heroku/node/bin/node]
Aborted
error Command failed with exit code 134.
I bumped up our Heroku dyno from 512MB of RAM to a Standard 2X with 1GB for $50/month, but still crashes. To get more RAM, I'd have to go with a Performance M dyno for $250/month, which is not affordable especially given I'll need three environments (test, staging, and production). Wondering if anyone else has run into this problem?