Subject: | Memory Leak in List::Uniq::uniq |
Date: | Wed, 07 Oct 2015 17:37:36 +0200 |
To: | bug-List-Uniq [...] rt.cpan.org |
From: | "Heinrich Mislik" <Heinrich.Mislik [...] univie.ac.at> |
List::Uniq::uniq leaks memory when flatten == 1;
Testprogram:
#!/usr/bin/perl
use strict;
use warnings;
use List::Uniq 'uniq';
use Memory::Usage;
my $count = 1000;
my $flatten = shift;
my $mu = Memory::Usage->new;
$mu->record("before");
for(0 ... $count)
{
my @list = ((1 ... 2000),(1000 ... 3000));
my @uniq = uniq({flatten => $flatten},@list);
}
$mu->record("after $count runs of uniq");
$mu->dump;
Call with Parameter 0 or 1 to see difference
Cheers
Heinrich
--
Heinrich Mislik
Zentraler Informatikdienst der Universitaet Wien
A-1010 Wien, Universitaetsstrasse 7
Tel.: (+43 1) 4277-14056, Fax: (+43 1) 4277-9140