xerces-p-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shawn W. Devlin" <sdev...@recognia.com>
Subject Re: How to parse multiple documents?
Date Fri, 10 May 2002 18:36:58 GMT
Further investigation reveals that everything works fine as long as I 
don't call $Parser->getDocument();

Once I get a document the memory does not seem to be released.

Shawn W. Devlin wrote:

> Hello,
>
> My program (using Xerces 1.5.2, Linux) waits for a signal then loads 
> and parses an XML document. Over a prolonged run I found that my 
> program used all available memory on the box. After stripping away all 
> of the extra code, I was able to determine that it is the Xerces 
> module that is not releasing the memory. I am sure that the problem 
> lies with my code in that I am not calling some method to release the 
> memory but I cannot find that method. I have tried  various 
> combinations of defining and undefining variables and so far no luck.
>
> If someone could point out my mistake it would be greatly appreciated.
>
> Thanks,
>
> Shawn
>
>
> PS. The following is a program that exhibits the behaviour:
>
>
> #!/usr/bin/perl -w
> use strict;
> use XML::Xerces;
> use XML::Xerces::DOMParse;
>
> my $Document = '';
> my $key = '';
> while ($key ne "q\n") {
>    my $Parser = XML::Xerces::DOMParser->new();
>    $Parser->setValidationScheme($XML::Xerces::DOMParser::Val_Auto);
>    $Parser->setDoNamespaces(0);
>    $Parser->setCreateEntityReferenceNodes(1);
>    $Parser->setDoSchema(0);
>    $Parser->setToCreateXMLDeclTypeNode(1);
>
>    my $ErrorHandler = XML::Xerces::PerlErrorHandler->new();
>    $Parser->setErrorHandler($ErrorHandler);
>
>    my $is = 
> XML::Xerces::LocalFileInputSource->new("/recog_logs/daemon.pat");
>    $Parser->parse($is);
>    $is = undef;
>
>    $Document = $Parser->getDocument();
>    $Document = undef;
>    $Parser = undef;
>    $ErrorHandler = undef;
>    $key = <STDIN>;
> }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-p-dev-help@xml.apache.org
>
>
>


-- 
This communication is intended to be received by the individual or
entity to whom or to which it is addressed and it contains information
that is privileged, confidential and subject to copyright of 
Recognia Inc. Any unauthorized use, copying, review or
disclosure is prohibited. If received in error, please contact me by
phone at 613-623-6159 or by email at mailto:sdevlin@recognia.com.




---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org


Mime
View raw message