当我尝试制作5个并行的http请求/秒时,我从Meteor.http.get中收到内存泄漏:gist
match_ids.forEach(function(match_id){
var url = self.generateUrl(match_id);
Meteor.http.get(url, function(err, response){
if(!err && !response.data.result.error){
callback(null, response.data.result);
}else{
callback(err || response.data.result.error, match_id);
}
})
});
即使我将速率降低到1个请求/秒,它似乎表现相同。
Meteor.setInterval(function(){
module.feeder.getMatchesForCarry();
}, 2000);
Meteor.setInterval(function(){
Meteor.call("TEMP_d2_match_analyzerInsertSampleData", 9, function(err,response){});
}, 10000);
此问题的根源是Node还是Meteor?
如果我执行5个请求/秒,在大约5分钟的运行中我得到80-100兆的
答案 0 :(得分:0)
您共享的代码没有问题。你的记忆泄漏,如果这确实是你所观察到的,就在其他地方。