Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Memory leak #64

jgupta opened this Issue Aug 9, 2012 · 2 comments


None yet
3 participants

jgupta commented Aug 9, 2012

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

pub https://gist.github.com/3308329
sub https://gist.github.com/3308327

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.


mkoppanen commented Nov 28, 2012

@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 Nov 28, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment