0
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

getting this weird message and am not sure where to run the

node --max_old_space_size=<size> 

command. I tried running it after opening the node shell and it didn't seem to work and running it directly on the command line didn't work either. Any help would be appreciated.

s.renton
  • 33
  • 5
  • 2
    The first step in fixing this is figuring out where all that memory is going. Unless you're processing a large amount of data in an inefficient way, you probably have a memory leak. Knowing nothing else about your program nor seeing any of your code, there's not much else we can do to help you. – Jordan Running Mar 02 '17 at 16:11
  • 1
    Possible duplicate of [configuration max old space size in Nodejs](http://stackoverflow.com/questions/34079918/configuration-max-old-space-size-in-nodejs) – Cauterite Mar 02 '17 at 16:13

1 Answers1

0

If you have a look at the source: github/v8, it seems that you try to reserve one very big object? My experience is this happens if you try to parse a huge JSON object, but when I try to parse your output with JSON and node0.11.13, it just works fine.

You don't need more --stack-size, you need more memory: --max_new_space_size and/or --max_old_space_size.

The only hint I can give you beside that: try another JSON-parser and/or try to change the input format to JSON line instead of JSON only.

Ryan_
  • 64
  • 1
  • 9