Skip Menu |

This queue is for tickets about the XML-LibXML CPAN distribution.

Report information
The Basics
Id: 519
Status: resolved
Priority: 0/
Queue: XML-LibXML

People
Owner: Nobody in particular
Requestors: merijnb [...] iloquent.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in:
  • 1.30
  • 1.31
  • 1.40
Fixed in: (no value)



Subject: Memory leak when is used $elm->find
When running the following code : 1 # $msg holds XML message 2 while (1) { 3 my $parser = XML::LibXML->new(); 4 5 my $doc = $parser->parse_string($msg); 6 my $elm = $doc->getDocumentElement; 7 my $node = $elm->find('/xpath/that/finds/a/node'); 8 my $text = $node->to_literal->value; 9 undef $doc; 10 undef $parser; 11 } the program leaks memory. When line 7 is commented out (and 8) it does not leak. When line 9 is commented out the memory leak becomes a memory torrent, especially if $msg is big ( say 300k )