Memory leak - GC
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Gearman::XS |
Fix Released
|
Medium
|
Dennis Schön | ||
Bug Description
Client and worker stack grow and grow...
#!/usr/bin/perl -w
use strict;
use Gearman::XS qw(:constants);
use Gearman:
my $gmw = new Gearman:
$gmw->add_
$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:
my $cnt = 0;
my $gmc = new Gearman:
$gmc->set_
my $task = shift;
print $task->data() . "\n";
});
$gmc->add_
while(1) {
$gmc-
$gmc-
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:
my $cnt = 0;
sub gm_test {
my $gmc = new Gearman:
$gmc-
my $task = shift;
print $task->data() . "\n";
});
$gmc-
$gmc-
$gmc-
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
Changed in gearmanxs: | |
milestone: | none → 0.8 |
status: | Confirmed → Fix Committed |
Changed in gearmanxs: | |
status: | Fix Committed → Fix Released |
I can see the client stack growing with your example. The worker however doesn't leak memory. I'll investigate more.