Hi,

I'm using XML-Xerces_1.5.2_0, and I'm experiencing some problems with
memory leakage.  The code I am reads and writes several hundred
medium-sized XML documents, so it is fairly sensitive to memory leaks.

This simple Perl script illustrates the problem:

  use XML::Xerces;

  sub do_parse {
      my $file = shift;
      my $p = XML::Xerces::DOMParser->new();
      $p->setValidationScheme($XML::Xerces::DOMParser::Val_Never);
      $p->setDoNamespaces(1);
      $p->setToCreateXMLDeclTypeNode(1);
      $p->setDoSchema(0);
      my $eh = XML::Xerces::PerlErrorHandler->new();
      $p->setErrorHandler($eh);

  #    $p->parse($file);

  #    my $doc = $p->getDocument();
  }

  for(my $i =0 ; $i < 100000 ; $i++) {
      do_parse("foo.xml");
  }

This leaks.  However, if I comment out the setErrorHandler line it does
not.  Is there a circular link between the parser and error handler that
does not get deleted?

cheers,

Paul
-- 
Paul Warren, Client Services           DecisionSoft Ltd.
Telephone: +44-1865-203192             http://www.decisionsoft.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to