运行这个:
setInterval(function() {
console.log(process.memoryUsage());
}, 1000);
显示内存使用量不断增长:
{ rss: 9076736, heapTotal: 6131200, heapUsed: 2052352 }
... some time later
{ rss: 10960896, heapTotal: 6131200, heapUsed: 2939096 }
... some time later
{ rss: 11177984, heapTotal: 6131200, heapUsed: 3141576 }
为什么会这样?