#13 Possible Memory Leak

closed
nobody
None
5
2004-04-02
2004-04-02
No

If XML::XSLT->new and dispose will be executed in a
loop the perl process will grow ==> Possible memory leak?

==========================================

use strict;
use XML::XSLT;

my $xsl = "D:/transfer/XSL_BUG/HTML.xsl";
my $xmlfile = "D:/transfer/XSL_BUG/attributes.xml";

my $xslurl = makeURL($xsl);
my $xmlurl = makeURL($xmlfile);

my $i;
my $xslt;
for($i=0; $i<200; $i++) {
$xslt = XML::XSLT->new ($xslurl, warnings => 1);

$xslt->transform ($xmlurl);
print $xslt->toString;

$xslt->dispose();
}

0;

sub makeURL {
my $string = shift;

if( $string =~ m|^file\://|i ) { return $string; } #
if already URL format
$string =~ s|\\|\/|g; # replace \\ $string =~ s/\:/\|/o; # replace :
return "FILE://".$string; # add file://
}

Discussion

  • Jonathan Stowe
    Jonathan Stowe
    2004-04-02

    • status: open --> closed
     
  • Jonathan Stowe
    Jonathan Stowe
    2004-04-02

    Logged In: YES
    user_id=313586

    Yes,
    I am trying to track it down. It appears however that the
    leak may be in XML::DOM or XML::Parser as everything is
    being correctly disposed in XML::XSLT.