Skip to content

Memory leak when using flash socket/jsonp-polling transport #496

@gcazaciuc

Description

@gcazaciuc

Description
On IE9, on a Win7 machine the memory grows continously to the point where it crashes the browser when the flash socket/jsonp transport method is being used.
For flash socket transport the issue occurs when the data size is larger( a few KB ) and when the messages are sent fast and in a continous mode.
The issue reproduces on Socket.IO version 0.9.11 but also on older versions like 0.6.3 .

Steps to reproduce

Use Socket.IO version 0.9.11 .
On IE9( Win7 machine ) enable the flash-socket/JSONP-polling transport method.
Fire off the server, connect with the client and monitor the memory usage using "Resource monitor".

Expected Result

The memory is fairly stable or it grows but it gets de-allocated after a while.

Actual Result
The memory builds up continously to 1GB+ to the extent where it crashes the browser.

Testing code

Client side

var socket = io.connect('server_url', {port:3000, transports:[flashsocket']});

     socket.on('message', function (data) {

        console.log(data);

      });

Server side

var server = http.createServer(app);

io = io.listen(server, {"transports":['flashsocket']});

// Setup some test data
var testData = "a";
for( var i = 0; i < 16; i++ )
testData = testData+testData;

io.sockets.on('connection', function (socket) {

setInterval( function() {

socket.emit('message', testData);

}, 10);

});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions