You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we are running the following code in production and after a couple of days (with an average of 400 simultaneous socket connections on each front) node uses over 2.5gb of memory and increasing. Have anybody else had the same problem and does anybody know why?
process.on( 'uncaughtException', function( err ) { console.log( err ); } );
var io = require( 'socket.io' ).listen( 8080 );
function joinChannel( roomId ) {
this.join( roomId );
}
io.sockets.on( 'connection', function( socket ) {
socket.on( 'joinChannel', joinChannel );
} );
io.set( 'log level', 1 );
var http = require( 'http' );
var handlePostData = function( data ) {
var message = JSON.parse( data.toString() );
io.sockets'in'.volatile.emit( 'clientEvent', message );
};
var server = function( req, res ) {
req.addListener( 'data', handlePostData );
};
http.createServer( server ).listen( 1339 );
best regards Joakim
The text was updated successfully, but these errors were encountered:
Thanks for the tip, I did actually rewrite the room-handling (not using join at all) before posting, just to make sure it didn't create the leak. My worries right now is that it might either be socket.io that keeps data to old connections (have profiled the socket.io object and couldn't find anything) or even worse, that v8 doesn't release unused memory in windows as it should. Today we installed a CentOS machine to see if it is a node-windows issue, I will post results from that on Monday.
Hello,
we are running the following code in production and after a couple of days (with an average of 400 simultaneous socket connections on each front) node uses over 2.5gb of memory and increasing. Have anybody else had the same problem and does anybody know why?
process.on( 'uncaughtException', function( err ) { console.log( err ); } );
var io = require( 'socket.io' ).listen( 8080 );
function joinChannel( roomId ) {
this.join( roomId );
}
io.sockets.on( 'connection', function( socket ) {
socket.on( 'joinChannel', joinChannel );
} );
io.set( 'log level', 1 );
var http = require( 'http' );
var handlePostData = function( data ) {
var message = JSON.parse( data.toString() );
io.sockets'in'.volatile.emit( 'clientEvent', message );
};
var server = function( req, res ) {
req.addListener( 'data', handlePostData );
};
http.createServer( server ).listen( 1339 );
best regards Joakim
The text was updated successfully, but these errors were encountered: