Skip Menu |

This queue is for tickets about the Algorithm-ConsistentHash-Ketama CPAN distribution.

Report information
The Basics
Id: 83510
Status: resolved
Priority: 0/
Queue: Algorithm-ConsistentHash-Ketama

People
Owner: Nobody in particular
Requestors: ROBCLARKE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.00009
Fixed in: (no value)



Subject: buckets method appears to leak memory
When repeatedly calling the buckets method the amount of memory consumed by the process increases, so there appears to be a leak. Attached file reproduces
Subject: ketama_bucket_repro.pl
#!/usr/bin/perl use strict; use warnings; use Algorithm::ConsistentHash::Ketama; my $ket = Algorithm::ConsistentHash::Ketama->new(); $ket->add_bucket('test',1); print "before:", join(", ", &memusage), "\n"; for (1..100_000){ $ket->buckets(); } print "after: ", join(", ", &memusage), "\n"; exit 0; #from http://www.perlmonks.org/?node_id=115098 sub memusage { use Proc::ProcessTable; my @results; my $pid = (defined($_[0])) ? $_[0] : $$; my $proc = Proc::ProcessTable->new; my %fields = map { $_ => 1 } $proc->fields; return undef unless exists $fields{'pid'}; foreach (@{$proc->table}) { if ($_->pid eq $pid) { push (@results, $_->size) if exists $fields{'size'}; push (@results, $_->pctmem) if exists $fields{'pctmem'}; }; }; return @results; }
Fixed in 0.00010, which I just released. Thanks for the heads up!