Skip to content

high tls memory usage (rss) #1522

Closed
Closed
@ChALkeR

Description

@ChALkeR

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/

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpsIssues or PRs related to the https subsystem.memoryIssues and PRs related to the memory management or memory footprint.tlsIssues and PRs related to the tls subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions