Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Memory leak #64

jgupta opened this Issue · 2 comments

3 participants


I have created two scripts to test performance of PHP binding and found Memory leak.


sub eats memory very fast (over 2GB in 2-3 minutes). Pub looks stable at 10.1MB.

memory_get_usage() function shows stable memory usage of 327996.

On side note, node.js binding is showing msg rate of 60k/sec while PHP binding is showing rate of 400k/sec. I wounder if I am doing something wrong.


Putting the following line after line 6 of your 'pub' script seems to fix the problem for me:

$responder->setSockOpt(ZMQ::SOCKOPT_HWM, 10);

Basically what I think this means is your subscriber is not consuming messages as fast as publisher is sending them out.


@cameronjacobson is most likely right here. You can easily generate tons of messages before you consume them and flood the publisher. I think the issue with node.js is how zeromq is integrated into the event loop.

@mkoppanen mkoppanen closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.