Naturally, since you keep many thousands or tens of thousands of connections open, you will bear the cost of memory by doing this.
Here is what I would like to ask:
Are you adding things to an array or object that is populating?
Do you create powerful modules for every open connection?
Can you run the profiler to find out what it does? (People rave about this DTrace.)
Is it possible to conduct a survey at intervals for what you want, and not open web sockets?
Something else that you can try, if you cannot start the profiler, it registers the status of the application during its launch so that you can analyze the problem. This is an oldschool method, but you can register every time the function ends and see what the current memory usage is. It can also chew on memory, but if you find the problem this way, great.
The memory usage is checked through the Process module:
http://nodejs.org/api/process.html#process_process_memoryusage
Good luck and please let me know what you find out. I am curious to see how you solve this very difficult problem.
user1311072
source share