For some reason, after using socket.emit(), the data is still in memory, according to Chrome's dev tool. Since I have to use this line of code for many times, the memory usage keep raising. My JS code on client :
socket.emit('upload',{data: a_very_long_string});
Local variable (declare with var) in JS is garbage collected automatically when the function return. And if it was a global variable, you can always release it by delete. So I guess in your case, it is because some global variable is not released after emit().
I found this post talking about memory leak in Socket.IO, which could be helpful in your case. http://jpallen.net/2013/03/08/tracking-down-a-memory-leak-in-node-js-and-socket-io/
About releasing variables, you can refer to this question: Memory release from local variable in javascript.
That is a problem with socket.io. It is because of memory leak in websocket server.
See the solution posted here :