JS Allocation failed - process out of memory

Hey guys,
I’m using meteor-cluster to run my app on multiple CPUs. Every 4-6 hours, I get the following error log:

Kadira: Successfully connected
Kadira: completed instrumenting the app
FATAL ERROR: JS Allocation failed - process out of memory
Cluster: Exiting worker 3 with exitCode=null signalCode=SIGABRT
Cluster: Initializing worker 6 on port 9241

Sometimes I’m also getting this error:

Kadira: Successfully connected
Kadira: completed instrumenting the app
Cluster: Exiting worker 6 with exitCode=null signalCode=SIGSEGV
Cluster: Initializing worker 10 on port 14599

I’m using Kadira to monitor my app. My ram usage is about 1 GB, the server has 16 GB available. When the error happens, I can see how a lot of sessions just drop, which means, that my users instances crash and they have to reload the page.

Does anybody know what could cause this error and how I can fix it? I’m running 4 instances, because my server has 4 CPU cores.

It’s probably not related but I’ve seen this error pop up in publications and with SimpleSchema. It happens when you try to reference this and it is out of scope because you used arrow functions.

Mhh…I don’t think that this causes the problem, in our case the app is a Meteor 1.2 app without any own ES6 code. We’ve decreased the number of instances to 2. Since then this error never occured again.