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

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -