Subject: | serious memory leak in XML::Bare |
Hi David,
there is a serious memory leak in XML::Bare which prevents the module
from being used in long-running programs.
How to reproduce it:
1)
from your distribution get feed2.xml and do:
for i in $(seq 1 10); do cat feed2.xml >> /var/tmp/feed3.xml; done
2) then write the following program
---
use strict;
use warnings;
my $xml_string;
open FD, "</var/tmp/feed3.xml" or die "cannot open feed3";
while(<FD>) { $xml_string .= $_; };
close FD;
for (my $i=0; $i <= 20; $i++) {
my $ob = new XML::Bare ( text => $xml_string );
$ob->parse();
undef ($ob);
sleep(1);
}
---
3) run top
4) run the previously created program
now from top you will see that the program will start leaking memory,
during the last for cycles on my system that program was using 24mb of
memory.
Cheers
Antonio