title: mongodb 2.4.1 failing with 'process out of memory'
body: <p>I have the following mongo versions</p>
  
  <pre><code>db version v2.4.1    
  MongoDB shell version: 2.4.1,    
  </code></pre>
  
  <p>and</p>
  
  <pre><code>db version v2.2.1-rc1, pdfile version 4.5, 
  MongoDB shell version: 2.2.1-rc1
  </code></pre>
  
  <p>installed on <code>64-bit windows 7</code> machine.</p>
  
  <p>I have a collection having <code>10001000</code> (10 million+) records, when I use V 2.4.1 to aggregate, it fails with the following 
  error:</p>
  
  <pre><code>Fatal error in CALL_AND_RETRY_2
  Allocation failed - process out of memory
  </code></pre>
  
  <p>However when I use V 2.2.1-rc1, to aggregate the same collection, it works fine and gives result in around 1 minute.</p>
  
  <p>Sample document of the collection that is being aggregated:</p>
  
  <pre><code>{
  
      "_id" : ObjectId("516bdd1c39b10c722792e007"),
      "f1" : 10000010,
      "f2" : 10000000,
      "key" : 0
  }
  </code></pre>
  
  <p>Aggregation Command:</p>
  
  <pre><code>{$group: {"_id": "$key", total: {$sum: "$f1"}}}
  </code></pre>
  
  <p>Command used to populate records:</p>
  
  <pre><code>for(var i = 10011000; i &lt; 10041000; ++i)
  { 
      db.testp.insert({"f1": i+10, "f2": i, "key": i%1000})
  }
  </code></pre>