Description
https.request leaks in this example:
'use strict';
var https = require('https');
var options = {
hostname: 'google.com'
};
function next() {
setTimeout(iterate, 10);
}
function onError(error) {
console.log(error);
}
function noop() {}
function onResponse(res) {
console.log('statusCode: ', res.statusCode);
res.on('data', noop);
res.on('end', next);
}
function iterate() {
console.log(JSON.stringify(process.memoryUsage()));
console.log('iterating...');
https.request(options, onResponse).
on('error', onError).
end();
};
iterate();
rss
grows over time, heapUsed
remains about constant (~30m).
This could be reproduced with all released iojs versions that I tried v1.0.1 and v1.8.1.
Node v0.12.2 behaves better in this testcase: rss grows to about 100m, but goes down periodically (I wouldn't call that a perfect behaviour, let's call that «fine»).
53ba494, dad73f6 and 8a83eba are three sequental commits.
53ba494 is fine (as 0.12), dad73f6 fails to build, 8a83eba leaks.
dad73f6 is «upgrade v8 to 3.31.74.1» with 831 files changed, 104394 insertions(+), 21427 deletions(-).
Node v0.12.2 could be fine because it still uses v8 3.28.73.
io.js 1.0.0/1.1.0 + shared v8 3.30.33.16 behaves fine (the same as 0.12).
All the testcases and massif data are at http://oserv.org/bugs/iojs/memory0/