Subject: | Severe Memory leak |
Date: | Fri, 15 Jan 2010 04:03:05 +0100 |
To: | bug-Parse-RecDescent [...] rt.cpan.org |
From: | Andreas Gruber <agruber [...] tbi.univie.ac.at> |
Below is a simple linux perl program that shows that this module has
some memory leaks:
use warnings;
use strict;
use Parse::RecDescent;
for my $i ( 1 .. 1000 ) {
my $grammar = q {
# GRAMMAR SPECIFICATION HERE
};
my $parser = new Parse::RecDescent ($grammar);
my $mem = `ps h -o size $$`;
chomp($mem);
$mem = sprintf( "$i :: %.1f", $mem / 1024 );
print "$mem\n";
}
Even on an empty grammar (just comment):
Iteration 1: 1.8 MB
Iteration 1000: 5.1 MB