[zeromq-dev] subscriber module prompting "FATAL ERROR: OUT OF MEMORY"
Omer Bacharach
omer at toot-trading.com
Thu Sep 8 16:36:15 CEST 2011
what is hwm?
On Thu, Sep 8, 2011 at 4:58 PM, Ilja Golshtein <ilejncs at narod.ru> wrote:
> Hello.
>
> Your code looks correct, although I am not sure if is Ok to do setsockopt
> after connect.
>
> I guess it is zmq internal thread what eats all memory.
> To check if it is wrong just do some wait instead of recv.
>
> The only way to solve comes to my mind - use HWM.
> 08.09.2011, 17:38, "Omer Bacharach" <omer at toot-trading.com>:
>
>
> 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
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
> --
> Best regards,
> Ilja Golshtein.
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
--
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/5e882a6a/attachment.htm>
More information about the zeromq-dev
mailing list