Skip Menu | You are currently an anonymous guest. | Login | Return to Main | About rt.cpan.org
 

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

X Report information
Id: 13891
Status: resolved
Left: 0 min
Priority: 0/0
Queue: Scalar-List-Utils

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

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

X Attachments



X History Display mode: Brief headersFull headers
#   Wed Jul 27 10:46:41 2005 guest - Ticket created  
Subject: memory leak in List::Util::first
[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

[application/octet-stream 264b]
Message body not shown because it is too large or is not plain text.
#   Sat Oct 29 19:59:32 2005 GBARR - Status changed from 'new' to 'resolved'