You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I run the following example I see that ZMQ Subscriber leaks memory:
use 5.010;
use strict;
use warnings;
use ZMQ;
use ZMQ::Constants qw(ZMQ_PUB ZMQ_SUB ZMQ_SUBSCRIBE);
use Time::HiRes qw(usleep);
if (fork) {
$0 = "ZMQ Publisher";
my$ctx = ZMQ::Context->new;
my$sock = $ctx->socket(ZMQ_PUB);
$sock->bind("tcp://*:7654");
while (1) {
$sock->send( "Foo"x100, 0 );
usleep(1000);
}
}
else {
sleep 1;
$0 = "ZMQ Subscriber";
my$ctx = ZMQ::Context->new;
my$sock = $ctx->socket(ZMQ_SUB);
$sock->connect("tcp://localhost:7654");
$sock->setsockopt( ZMQ_SUBSCRIBE, '' );
while (1) {
my$msg = $sock->recv;
$msg->close;
}
}
I tested it on Debian Squeeze and Ubuntu 11.10 with libzmq 2.1.9 and 2.2.0.
The reason is seems that you're creating temporary zmq_msg_t structure and don't call zmq_msg_close on it. The following commit fixes the problem for me: trinitum/p5-ZMQ@6aa97bf
The text was updated successfully, but these errors were encountered:
If I run the following example I see that ZMQ Subscriber leaks memory:
I tested it on Debian Squeeze and Ubuntu 11.10 with libzmq 2.1.9 and 2.2.0.
The reason is seems that you're creating temporary zmq_msg_t structure and don't call zmq_msg_close on it. The following commit fixes the problem for me: trinitum/p5-ZMQ@6aa97bf
The text was updated successfully, but these errors were encountered: