Subject: | memory leak in XML::smart search function |
Date: | Sun, 14 Aug 2011 13:32:04 +0200 |
To: | bug-XML-Smart [...] rt.cpan.org <bug-XML-Smart [...] rt.cpan.org> |
From: | Jens WEBER <jweber [...] tek2b.org> |
Debian Squeeze: libxml-smart-perl, Version 1.6.9-3
root@xovoxbuilder:~/perl-tests/smart-xml-test# perl -v
This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
root@xovoxbuilder:~/perl-tests/smart-xml-test# uname -a
Linux xovoxbuilder 2.6.32-5-amd64 #1 SMP Sat Oct 30 14:18:21 UTC 2010 x86_64 GNU/Linux
following small program demonstrate the problem
#!/usr/bin/perl -w
#
use XML::Smart;
while (1) {
my $xml = XML::Smart->new( "test.xml" );
my $node = $xml->{test}{entry}('name','eq','test2'); # <--------- the problem is here
}
test.xml
<test>
<entry name="test1"/>
<entry name="test2"/>
</test>
root@xovoxbuilder:~/perl-tests/smart-xml-test# ./test.pl & top -d 1
top - 13:25:42 up 1 day, 21:27, 1 user, load average: 0.33, 0.09, 0.02
Tasks: 75 total, 2 running, 73 sleeping, 0 stopped, 0 zombie
Cpu(s): 48.0%us, 2.5%sy, 0.0%ni, 49.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1027156k total, 954072k used, 73084k free, 94956k buffers
Swap: 498680k total, 0k used, 498680k free, 716824k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
15663 root 20 0 50132 33m 1816 R 101 3.3 0:17.32 test.pl
memory goes up really fast.
sincerly Jens