[zeromq-dev] PUB/SUB socket result in server's crash

Pieter Hintjens ph at imatix.com
Thu Jul 21 11:47:38 CEST 2011

On Thu, Jul 21, 2011 at 11:23 AM, yy l <liyongyan0523 at gmail.com> wrote:

> As you said, "test" code is almost commented out. But that is exactly what I
> confused. My server doesn't send any data but only bind the socket. However,
> it's memory still grows continunously.

Your client keeps connecting, which is incorrect. 0MQ sockets will
automatically reconnect when their peer comes online. So you create a
socket ONE time, connect ONE time, and then wait for data to arrive.

By creating sockets and connecting them over and over, you are doing a
denial-of-service on the server, and it is normal that the process
(server, and also client, probably) will run out of socket handles and
fill up memory.


More information about the zeromq-dev mailing list