node.js - Mongoose stream & setInterval leading to memory leaks? -
i'm trying diagnose memory leak problem in node application. i'm confused gc in v8, , don't know how prevent memory leaks in node. have below code uses mongoose query stream in setinterval
.
setinterval(function() { var stream = book .find({}) .stream(); stream.on('data', function(book) { // ... book.updated_at = new date(); book.save(); // ... }); stream.on('error', function(err) { }); stream.on('close', function() { }); }, 1000);
can event handlers inside setinterval
lead memory leaks?
Comments
Post a Comment