首页 > nodejs 官方例子在ab测试时候,为什么内存只升不降?

nodejs 官方例子在ab测试时候,为什么内存只升不降?

使用官方的测试案例:

var http = require('http');

var hostname = '127.0.0.1';
var port = 3000;

http.createServer(function(req, res) {
  res.writeHead(200, { 'Content-Type': 'text/plain' });
  res.end('Hello World\n');
}).listen(port, hostname, function() {
  console.log('Server running at http://' + hostname + ':' + port + '/');
});

执行ab测试:ab -n 10000 -c 20 http://127.0.0.1:3000/

初期系统运行内存为:8196k

执行一次后内存为:49776k

环境使用的是windows + v0.12版本nodejs

想问下是什么原因导致内存暴涨那么多?如果查看具体的原因,有没有什么比较好的检测内存泄漏的方法?

【热门文章】
【热门文章】