[zeromq-dev] subscriber module prompting "FATAL ERROR: OUT OF MEMORY"

Omer Bacharach omer at toot-trading.com
Thu Sep 8 15:38:02 CEST 2011


> Hi
> I'm using zmq on windows.
>
> I'm using a subscriber with a filter to receive only "12345" a million
> times and I have a publisher sending "12345" repeatedly
> When running both modules the subscriber shouts (after a while): "FATAL
> ERROR: OUT OF MEMORY".
> Any idea?
>
> Here is the relevant snippet from the subscriber's code:
>
>
>     zmq::context_t context (1);
>
>     //  Socket to talk to server
>     std::cout << "Collecting updates from weather server…\n" << std::endl;
>     zmq::socket_t subscriber (context, ZMQ_SUB);
>     subscriber.connect("tcp://localhost:5556");
>
>     subscriber.setsockopt(ZMQ_SUBSCRIBE, "12345", strlen ("12345"));
>
>     int update_nbr;
>     zmq::message_t update;
>
>     for (update_nbr = 0; update_nbr < 1000000; update_nbr++)
>  {
>
>         subscriber.recv(&update);
>         std::cout << update.size();
>
>  }
>
>
> Regards,
> Omer.
> --
> Omer Bacharach
> Director of Software Development
> Toot Trading Ltd.
> omer at toot-trading.com
> Mobile +972-544-317959
> Office +972-3-7449466
>
>
>


-- 
Omer Bacharach
Director of Software Development
Toot Trading Ltd.
omer at toot-trading.com
Mobile +972-544-317959
Office +972-3-7449466
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110908/9345415e/attachment.htm>


More information about the zeromq-dev mailing list