title: Getting Heap out of memory Error even when available heap memory is much larger than used
body: <p>I'm getting the following error even when I run node with high heap memory using the following command: <code>node --max-old-space-size=8000  manipulateFiles.js</code></p>
  
  <pre><code>FATAL ERROR: invalid table size Allocation failed - JavaScript heap out of memory
  1: 0x8dc510 node::Abort() [node]
  2: 0x8dc55c  [node]
  3: 0xad9b5e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
  4: 0xad9d94 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
  5: 0xec7bf2  [node]
  6: 0x102d7b2 v8::internal::OrderedHashTable&lt;v8::internal::OrderedHashMap, 2&gt;::Allocate(v8::internal::Isolate*, int, v8::internal::PretenureFlag) [node]
  7: 0x1030946 v8::internal::OrderedHashTable&lt;v8::internal::OrderedHashMap, 2&gt;::Rehash(v8::internal::Handle&lt;v8::internal::OrderedHashMap&gt;, int) [node]
  8: 0x1030f69 v8::internal::OrderedHashTable&lt;v8::internal::OrderedHashMap, 2&gt;::EnsureGrowable(v8::internal::Handle&lt;v8::internal::OrderedHashMap&gt;) [node]
  9: 0x1114c7e v8::internal::Runtime_MapGrow(int, v8::internal::Object**, v8::internal::Isolate*) [node]
  10: 0x908bb15be1d 
  Aborted (core dumped)
  </code></pre>
  
  <p>The amount of heap memory used at the time of the crash is 1.79G. The amount available is 6.15G. I used the v8 module and <code>process</code> to get those numbers.</p>
  
  <p>So apparently something else besides the heap size is causing the issue. the module basically scans a large CSV file and builds a Map for later reference in the process. This map can have up to 30 million keys. the module worked fine on other smaller files (10 million keys). but it keeps giving this error here even when the available heap size is far larger than being used. </p>
  
  <p>What else could cause a problem like this?</p>