title: Fatal error in ../deps/v8/src/handles.h, CHECK(location_ != NULL) failed / FATAL ERROR: CALL_AND_RETRY_0 Allocation failed - process out of memory
body: <p>I installed node on an ubuntu server and am trying to run a basic node program from the server. In it, I try to read in 13 json files, ranging from 120mb - 500+ mb. Previously, I was running it locally, which was ok for the smaller files but was running into the following error when trying to read the larger ones:</p>
  
  <pre><code>FATAL ERROR: CALL_AND_RETRY_0 Allocation failed - process out of memory
  </code></pre>
  
  <p>I need to be able to parse through the json object after reading the file, so I can't read it line by line. And I need to be able to build a cumulative object from the results of parsing all the objects. Like I said, the code works just fine and produces the result I expect when handling 3+ smaller files (&lt; 20mb), but crashes with the larger ones.</p>
  
  <p>When trying to run it on the server, I have the same issue (it'll work just fine with smaller files), but crashes with the following error on larger ones:</p>
  
  <pre><code># Fatal error in ../deps/v8/src/handles.h, line 48
  # CHECK(location_ != NULL) failed
  #
  
  ==== C stack trace ===============================
  
   1: V8_Fatal
   2: v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::String::NewStringType, int)
   3: node::StringBytes::Encode(v8::Isolate*, char const*, unsigned long, node::encoding)
   4: node::Buffer::Utf8Slice(v8::FunctionCallbackInfo&lt;v8::Value&gt; const&amp;)
   5: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo&lt;v8::Value&gt; const&amp;))
   6: ??
   7: ??
  [1]    12381
  </code></pre>
  
  <p>illegal hardware instruction (core dumped)  node main2.js</p>
  
  <p>This is the code chunk it's failing in:</p>
  
  <pre><code>for (var i = 0; i &lt; jsonFileArray.length; i++) {
      if (jsonFileArray[i].match(/\.json$/)) {
        jsonObject = JSON.parse(fs.readFileSync(dirPath + jsonFileArray[i]));
        categoryListObject = jsonManipulator.getFieldValues("Categories", jsonObject, categoryListObject);
      }
  }
  </code></pre>
  
  <p>I tried increasing my --max-old-space-size, but that didn't help. Also, I should clarify, I'm pretty new to coding and have never written anything in C, so despite googling this, I'm not really sure where to go next. So really, any help/guidance/insight/step in the right direction would be super appreciated! Thanks!</p>