Created
October 16, 2014 14:55
-
-
Save peteruithoven/dd432184667591d7d42a to your computer and use it in GitHub Desktop.
Monitoring the server using pm2 indicates a memory leak. The memory usage increased and didn't decrease. Not even when stopping broadcaster.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var io = require('socket.io-client'); | |
var PORT = 6000; | |
var socket = io.connect('http://localhost:'+PORT,{forceNew:true}); | |
socket.once('connect',function() { | |
console.log("connected"); | |
setInterval(function() { | |
console.log("emit image"); | |
for(var i=0;i<100;i++) { | |
socket.emit('image', {name: "bob"}); | |
} | |
},100); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http').Server(); | |
var io = require('socket.io')(http); | |
var PORT = 6000; | |
http.listen(PORT, function(){ | |
console.log('server listening on *:' + PORT); | |
}); | |
var nsp = io.of('/'); | |
nsp.on('connection', onConnection); | |
function onConnection(socket) { | |
console.log("new connection"); | |
socket.on('image', onImage); | |
} | |
function onImage(data) { | |
// console.log("on image: ",data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment