Skip Menu |
 

This queue is for tickets about the Scalar-List-Utils CPAN distribution.

Report information
The Basics
Id: 13891
Status: resolved
Priority: 0/
Queue: Scalar-List-Utils

People
Owner: Nobody in particular
Requestors: karl.forner [...] serono.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.17
Fixed in: (no value)

Attachments


Subject: memory leak in List::Util::first
Download (untitled) / with headers
text/plain 709b
under perl 5.8.6 gcc 3.4.3 both on linux and solaris. Memory leak in List::Util::first : the memory usage of the process keeps increasing (but should be constant) until "out of memory" I've managed to reduce the bug to the following script: #! /usr/bin/env perl use warnings; use strict; use List::Util; my $nb_tests = 70000; my @tab = (0..1000); foreach my $si (0..$nb_tests-1) { print STDERR "$si\r"; my @scores = (1..$nb_tests); my $rank = List::Util::first { $scores[$_] < 2 } @tab; } Execute the script and watch the memory usage... It seems that the @scores array is not garbage-collected. Hope that may help improving this very useful neat piece of software. Thanks Karl Forner
Download leak_list_util.pl
text/x-perl 264b
#! /usr/bin/env perl use warnings; use strict; use List::Util; my $nb_tests = 70000; my @tab = (0..1000); foreach my $si (0..$nb_tests-1) { print STDERR "$si\r"; my @scores = (1..$nb_tests); my $rank = List::Util::first { $scores[$_] < 2 } @tab; }


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.