KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
We are trying to setup Node.js + Socket.io. Our last concern is memory usage. We are starting our simple server (code below) and virtual memory usage of this process is ~600 mb. 1000 6463 0.0 0.4 635816 19260 pts/1 Sl+ 12:51 0:00 node /home/data/server.js server.js : var express = require('express'); var app = express.createServer(), io = require('socket.io').listen(app); app.listen(8000); io.set('flash policy port', 8001); io.enable('browser client minification'); // send minified client io.enable('browser client etag'); // apply etag caching logic based on version number io.set('log level', 1); io.set('transports', [ 'websocket' , 'flashsocket' , 'htmlfile' , 'xhr-polling' , 'jsonp-polling' ]); io.sockets.on('connection', function (socket) { socket.on('distribute', function (data) { if(typeof data.key == 'undefined' || (typeof data.key != 'undefined' && data.key != 'randomstringforsecurityreason')){ return false; } delete data.key; socket.broadcast.to(data.channel).emit('eat', data); }); socket.on('pukpuk', function(data) { if(typeof data == "string"){ socket.join(data); } else { for(var i in data) { socket.join(data[i]); } } }); }); It is normal? So big virtual memory usage? Edit: Ok, I found that it's pretty normal. http://comments.gmane.org/gmane.comp.lang.javascript.nodejs/17482
Tags (comma-separated)
Save Edits
Cancel