FatalProcessOutOfMemory - help

Hello everyone, i am running meteor app on a docker container using meteor-mup.

The system is using the following spec:
4 core
8 GB RAM
SSD memory

I got the following error and i have no idea where to look solution for (the following log i got from last few lines from docker logs command)


spiderable: phantomjs failed at https://bchurunway.com/: null
stderr:
stdout:
spiderable: phantomjs failed: { Error: Command failed: /bin/bash -c exec phantomjs --load-images=no --ignore-ssl-errors=yes /tmp/meteor_1983704496

    at ChildProcess.exithandler (child_process.js:270:12)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:927:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
  killed: true,
  code: null,
  signal: 'SIGTERM',
  cmd: '/bin/bash -c exec phantomjs --load-images=no --ignore-ssl-errors=yes /tmp/meteor_1983704496' }
stderr:
(node:8) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
XXXX  stock
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

<--- Last few GCs --->

[8:0x247a090] 105337740 ms: Mark-sweep 1388.7 (1660.5) -> 1388.4 (1662.0) MB, 1912.9 / 0.2 ms  allocation failure GC in old space requested
[8:0x247a090] 105339874 ms: Mark-sweep 1388.4 (1662.0) -> 1388.4 (1602.0) MB, 2133.7 / 0.5 ms  last resort
[8:0x247a090] 105341871 ms: Mark-sweep 1388.4 (1602.0) -> 1388.4 (1580.0) MB, 1997.2 / 0.1 ms  last resort


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x1d872941cef1 <JSObject>
    1: DoJoin(aka DoJoin) [native array.js:~95] [pc=0x1669e9dfba89](this=0x1d8729402241 <undefined>,p=0x1f9ae4dd6ff1 <JSArray[18]>,q=18,E=0x1d87294022c1 <true>,A=0x210e9a119e61 <String[1]\: \n>,z=0x1d87294022f1 <false>)
    2: Join(aka Join) [native array.js:~120] [pc=0x1669e9e05c29](this=0x1d8729402241 <undefined>,p=0x1f9ae4dd6ff1 <JSArray[18]>,q=18,A=0x210e9a119e61 <String[1]\: \n>,z=0x1d87294...

 1: node::Abort() [node]
 2: 0x13740dc [node]
 3: v8::Utils::ReportOOMFailure(char const*, bool) [node]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
 5: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [node]
 6: v8::internal::Runtime_StringBuilderJoin(int, v8::internal::Object**, v8::internal::Isolate*) [node]
 7: 0x1669e9c840dd
/opt/meteord/run_app.sh: line 50:     8 Aborted                 (core dumped) node main.js

I checked around some forums and found something with heap memory size being only 1 GB.

i have normally noticed the system starts to malfunction in performance (site sometimes doesnot load ) when the system has occupied only 2 gb in total (6 GB still left).

Any help or solution to fix this issue will be awesome.

Thanks in advance

Did you ever figure out what happened I’m seeing this all the time with no indication whats up and I can’t get APM working (not sure if that would even help me track it down):

(node:7) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.

We need god damned source maps in meteor. I’ve been a die hard meteor advocate for 3 years but if I had the extra time I’d move all my stuff off it. There’s just no support and the package community is dead. All the most important packages are stale.

1 Like

your first error obviously seems to be related to phantomjs. That is only for the (deprecated) prerender using phantomjs. Do you use the spiderable package?

I already started to move stuff off from this ! I never found a fix, for me it was due to a new package i tried to install, i simply had to find an alternate for the package (was a report generating package)

Hey, yes it may look like its a phantomjs error, but it is not , it is just kinda error but does not block the process (so in generic term, is a warning)
I found this to be caused by many cases

  1. adding new packages
  2. no memory (Space)

no space:
So i have a 8 gig cpu, and when i deploy a app, the app crashes after reaching 2 GIG RAM, so i changed meteor-up docker code, created my own container for which i increased to use the memory till 7.9 GIG

I am bit annoyed and reluctant to use meteor for future projects cause of the inconsistency. :confused: . It is not bad, it helps a lot, but for few cases it terrifies a dev :smiley:

The environment variable NODE_OPTIONS may help here. To allow node to use 4GB:

export NODE_OPTIONS="–max_old_space_size=4096"

or put it at the start of your meteor startup command:
NODE_OPTIONS="–max_old_space_size=4096" meteor

I know I have to use this option in my dev environment.

1 Like

Yes, it did indeed help.

I did create my own container https://hub.docker.com/r/sidzan/mup/ which does the same thing.

node --max-old-space-size=7168  main.js

Those are the only code i changed.

for me the mup (meteor-up) was handling this, so i had to create a different container to support .