Comment 10 for bug 507781

Revision history for this message
Dennis Schön (roccoblues) wrote : Re: [Bug 507781] Re: Memory leak - GC

Hi Jeremy,

I wanted to wait for the next libgearman release. There are some
bugfixes in there as well. I'll ping Eric and Brian and check what
their timeline is.

On Feb 1, 2010, at 7:17 PM, Jeremy Zawodny wrote:

> Dennis, what's the timeline for a new CPAN release?
>
> --
> Memory leak - GC
> https://bugs.launchpad.net/bugs/507781
> You received this bug notification because you are a member of
> Gearman-
> developers, which is the registrant for Gearman::XS.
>
> Status in Gearman Perl Frontend: Fix Committed
>
> Bug description:
> Client and worker stack grow and grow...
>
> #!/usr/bin/perl -w
>
> use strict;
> use Gearman::XS qw(:constants);
> use Gearman::XS::Worker;
>
> my $gmw = new Gearman::XS::Worker;
>
> $gmw->add_server("gmanserver");
>
> $gmw->add_function(
> "gmw_test", 0, sub {
> my ($job, $options) = @_;
>
> print "workload: " , $job->workload(), "\n";
> print "handle: ", $job->handle(), "\n";
> print "unique: ", $job->unique(), "\n";
> }, ''
> );
>
> my $cnt=0;
> while (1) {
> my $ret = $gmw->work();
> if ($ret != GEARMAN_SUCCESS) {
> print STDERR $gmw->error(), "\n";
> die "worker giving up (pid: $$)";
> }
> print "CNT: $cnt\n";
> $cnt++;
> }
>
> #!/usr/bin/perl -w
> use strict;
> use Data::Dumper;
> use Gearman::XS qw(:constants);
> use Gearman::XS::Client;
>
> my $cnt = 0;
> my $gmc = new Gearman::XS::Client;
> $gmc->set_complete_fn(sub {
> my $task = shift;
> print $task->data() . "\n";
> });
> $gmc->add_server("gmanserver");
>
> while(1) {
> $gmc->add_task("gmw_test", "test data", 0);
> $gmc->run_tasks();
> print "CNT: $cnt\n";
> $cnt++;
> }
>
> The code bellow leaks memory and leaves net ESTABLISHED connections
> around
>
> #!/usr/bin/perl -w
>
> use strict;
> use Gearman::XS qw(:constants);
> use Gearman::XS::Client;
>
> my $cnt = 0;
> sub gm_test {
> my $gmc = new Gearman::XS::Client;
> $gmc->set_complete_fn(sub {
> my $task = shift;
> print $task->data() . "\n";
> });
> $gmc->add_server("gmanserver");
> $gmc->add_task("gmw_test", "test data", 0);
> $gmc->run_tasks();
> print "CNT: $cnt\n";
> $cnt++;
> }
>
> while(1) {
> gm_test();
> }
>
>
> netstat -a | grep gmanserver | wc -l
> to confirm
>
> Let me know if I can provide any more info or assist in any way.
>
> -James
>
>