[zeromq-dev] PUB socket and memory
Chuck Remes
cremes.devlist at mac.com
Wed Dec 14 21:53:55 CET 2011
On Dec 14, 2011, at 1:43 PM, Andrei Zmievski wrote:
> I have a publisher sending data on a PUB socket, and a non-durable (no identity set) subscriber listening on a SUB socket. If the publisher starts sending messages first and the subscriber never starts, I see unbounded memory usage growth for the publisher process. I though this was only supposed to happen if there was a durable subscriber (that crashed, for example) and no HWM set on the PUB socket?
It depends. If you are connecting the PUB socket to the SUB socket, then the PUB socket creates an internal queue and starts feeding data into it. By default the HWM is 0 so it's unbounded.
If you bind the PUB socket, then no internal queue is created. Any messages sent without a subscriber are dropped.
This should probably be documented beyond the mailing list.
cr
More information about the zeromq-dev
mailing list