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

Popular posts from this blog

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -