Node.js simple script memory leak
Here is a simple code
var fn = function () {
return null;
}
setInterval(fn, 100);
setInterval(function () {
global.gc();
console.log(process.memoryUsage().rss);
}, 1000);
Runnig
node --expose-gc / tmp / test.js
Result:
10330112
10596352
10596352
10596352
10932224
10932224
10932224
... several minutes
11198464
11198464
11198464
Why is memory increasing?
+3
source to share
No one has answered this question yet
Check out similar questions: