A kind of memory leak on nodeJs?

I have some problems with a "memory leak issue" in several versions of NodeJs.

EDIT : I've tried several version of nodeJs : v0.8.10, v0.10.22, v0.10.23, v0.10.24 ... I'm under MacOsX 10.9.1.

Here is my test.js :

function a() { 
  console.log( process.memoryUsage() );
  global.gc();
}
var b = setInterval(a,5000);

I launch it with :

node --expose-gc test.js

Here is the output :

 { rss: 12312576, heapTotal: 5115392, heapUsed: 2429656 }
 { rss: 13406208, heapTotal: 6163968, heapUsed: 2139848 }
 { rss: 13463552, heapTotal: 6163968, heapUsed: 1911320 }
 { rss: 14295040, heapTotal: 6163968, heapUsed: 1919632 }
 { rss: 14434304, heapTotal: 6163968, heapUsed: 1898944 }
 ... etc ...

As you can notice, RSS doesn't stop growing, heapTotal is stable, heapUsed moves but stays balanced.

Does somebody understand why RSS (Resident Set Size) is still growing ? Is it normal ? Is it a native node memory leak ?

What's happen on your machines ?

EDIT : I've tried on a linux server and the headTotal and RSS are stable ! Looks like a issue on nodeJs for MacOs ?! Somebody knows why ?

Thanks !

链接地址: http://www.djcxy.com/p/52634.html

上一篇: 检测需要很长时间的node.js http.get调用

下一篇: nodeJs上的一种内存泄漏?