Blog

Re: perl 5.16.0 でメモリリーク?

http://d.hatena.ne.jp/tagomoris/20120731/1343713558

以下のコードで再現するので、Perl 5.16.0 のバグのようです。もりもりプロセスがふとっていきます。

use strict;

my $kan = bless +{}, 'Kan';
my $code = sub { };

for (1..100) {
    for (1..1000) {
        for my $f ($code, $kan) {
            ref $f;
        }
    }
    my @x = split /\s+/, `ps aux|grep leak.pl|grep -v grep| grep -v vim`;
    print $x[5], $/;
}

ref のキャッシュ処理とかがバグってるとかですかね。

とりあえず perlbug しておきました。

see http://www.nntp.perl.org/group/perl.perl5.porters/2012/08/msg190132.html
https://github.com/mirrors/perl/pull/9