For some months I'm desperately searching for a memory leak in my Node
It's a simple publish/subscribe WebSocket server that serves about
15-20.000 concurrent clients.
With Node 0.4 and miksago's node-websocket-server library the memory
consumption was ok, and the memory was freed again at night, when there
were only a few clients (about 2.000).
However after upgrading to Node 0.6 OR using a different library
(WebSocket.IO, ws, websock or faye-websocket - Anything that supports the
new hybi protocol), the server starts to leak memory.
At startup it consumes needs about 20 MB memory (RSS), with 15.000 clients
memory grows to about 250 MB. That's ok so far, however the RSS grows at
about 100 MB per hour, which is far too much.
How can I debug this behavior? I tried node-inspector, but v8-profiler only
works with Node 0.4. Running node-gc every few seconds smoothes the memory
curve, but does not help anything.
I observed that process.memoryUsage().heapTotal stays at an acceptable
level (about 150 MB), only rss grows until the process gets killed. Does
this tell anything, e.g. Buffer leak? (I know the WebSocket modules use
lots of small buffers, but they should get freed, shouldn't they?).
Do you have any hint where I can look for leaks?
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
For more options, visit this group at