SetInterval is hogging up resources- alternatives the Node.js way -


below simple function reports time system resources 100 times second:

var util = require('util');  function report(){     console.log(new date());     console.log(util.inspect(process.memoryusage())); }  setinterval(report,10); 

sure, example isn't practical- more illustrative purposes

it works- memory allocation goes up , , up. understanding, isn't memory leak- rather natural behavior of javascript. due function, or record of performed functions being added heap every time setinterval called. , long process alive.

so here's question:

is there better way achieve same output, more efficiently?


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -