[zeromq-dev] Slow subscriber runs out of memory

a frost afrost408 at gmail.com
Mon May 23 17:17:13 CEST 2011


I am evaluating ZMQ, doing some initial testing with a PUB-SUB
configuration. The publisher and subscriber are in separate processes on the
same machine. I am using TCP transport and have set HWM=10 on both sides.

The subscriber is slow compared to the publisher and its memory usage
increases rapidly as messages are received from the publisher.  Eventually,
the subscriber process runs out of memory.

I want messages to be discarded at the subscriber end if it cant process
them fast enough, rather than memory usage increasing without bound as
received messages are buffered. I thought setting HWM on the SUB side would
give me this behaviour, but setting this has no effect on memory usage.

Any help would be appreciated. Source code for my test programs is at:

Publisher: http://pastebin.com/2YtRAi8C
Subscriber:  http://pastebin.com/Sr16RP75

OS: Windows XP SP3 64bit
libzmq: zeromq-2.1.7
clrzmq2: zeromq-clrzmq2-f420936
Both libraries are compiled for x86 but are running on a 64bit PC

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110523/8ce2a430/attachment.htm>

More information about the zeromq-dev mailing list