Meteor.setTimeout() memory leak? -


i've created new project 1 file (server.js) on server tiny piece of code nothing. but, after running it, node process using 1gb of memory. know why?

for (var = 1000000; >= 0; i--) {     meteor.settimeout(function(){},1000); }; 

apparently meteor.settimeout() function or uses (closure?) prevents gc clearing memory after has been executed. ideas?

since calling on server side, meteor.settimeout lot more complex appears on surface. meteor.settimeout wraps settimeout meteor.bindenvironment(), binding context of current environment timeout callback. when timeout triggers, pull in context of when called.

a example if called meteor.method() on server , used meteor.settimeout() within it. meteor.method() keep track of user called method. if use meteor.settimeout() bind environment callback timeout, increasing amount of memory needed empty function().

as why there isn't garbage collection occurring on server, may not have hit it's buffer. tried running test , virtual memory hit around 1.2gb, never went higher, after subsequent tests. try running code multiple times see if memory consumption continues increase linearly, or if hits ceiling , stops growing.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -