Hi, allI will really appreciate if someone can explain me the reason of issue.I faced the memory leak issue during inserting 10 million records into MongoDB using NodeJS native driver (Windows 7 / 64 bit). I had only 1.5 million inserted, node.exe process took more than 1GB RAM and the following error occurred FATAL ERROR: CALL_AND_RETRY_2 Allocation failed - process out of memory.Please find the code of nodeunit test below.var mongo = require('../code/node_modules/mongodb');var MONGO_URL = "mongo://127.0.0.1:27017/mongoTests?safe=false";module.exports = {"insert 10 million records into mongo": function (test) {mongo.Db.connect(MONGO_URL, function (err, db) {if (err) {test.fail(err);return;}var countOfRecordsToBeInserted = 10000000;var countOfInsertedRecords = 0;var collection = db.collection('test');var onInsert = function (err) {if (err) {db.close();test.fail(err);test.done();return;}countOfInsertedRecords++;if (countOfInsertedRecords >= countOfRecordsToBeInserted) {db.close();test.done();}};var insertRecord = function (data) {collection.insert(data, onInsert);};for (var i = 0; i < countOfRecordsToBeInserted; i++) {var data = {a: 'text ' + i,b: i,d: new Date()};insertRecord(data);}});}};
Yes - I've just run into this with an extremely simple node program that just loops calling collection.insert() with an object. If I remove the call to collection.insert() then it runs fine, otherwise I get the same error. This is on OS X.G.
On Monday, November 5, 2012 4:24:45 PM UTC, Jeroen Janssen wrote:Has anyone else seen similar 'behaviour'? Or maybe knows what exactly is causing this?
Can somebody post the JIRA links please ?