You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by ne...@ca.ibm.com on 2002/01/14 19:51:59 UTC

Re: Memory used when parsing an xml file...

Hi Paulo,

Try posting this message to xerces-c-dev@xml.apache.org.  You've got the
list for the Java parser here.

Cheers,
Neil

Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  905-413-3519, T/L 969-3519
E-mail:  neilg@ca.ibm.com



Paulo Pizarro <pa...@digitro.com.br> on 01/14/2002 04:48:51 PM

Please respond to xerces-j-dev@xml.apache.org

To:   xerces-j-dev@xml.apache.org
cc:
Subject:  Memory used when parsing an xml file...


I am using Xerces 1.6.0 and find that quite a bit of memory is used and
retained when parsing an xml file.

The file I am using is about 500 Kbytes and running a short program that
only
parses the file the memory usage is about 12 MBytes.  This is in release
mode
and i need use DOM (IDOM).

Does this seem correct?  Should I be expected much greater memory
efficiency?
Does it make a difference with the depth of the elements in the tree?

The simple program I wrote to test this is as follows.

                parser = new IDOMParser;
                parser->setIncludeIgnorableWhitespace(false);
                parser->setCreateEntityReferenceNodes(false);
                //parser->setValidationConstrainFatal(true);
                parser->setDoSchema(false);
                parser->setValidationScheme(IDOMParser::Val_Auto);
                parser->setValidationSchemaFullChecking(false);
                parser->setDoNamespaces(false);

                const char* xmlFile = "prefixos.xml";

                parser->parse(xmlFile);

XML file example:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE tarifador [
 <!ELEMENT tarifador (prefixos+)>
 <!ATTLIST tarifador
           versao CDATA #REQUIRED>
 <!ELEMENT prefixos (p+)>
 <!ATTLIST prefixos
   area_tar_origem CDATA #REQUIRED>
 <!ELEMENT p EMPTY>
 <!ATTLIST p
           ID ID #REQUIRED
           d (00 | 01 | 02 | 03 | 04 | 0C | 10 | 30 | 50) "04"
           u (SC | RR | RO | PI | AP | AL | PB | SE | RN) "SP"
           r (1 | 2 | 3) "1"
           c (S | N) "N">
]>

<tarifador  versao="0.1">
           <prefixos area_tar_origem="482">
                     <p ID="P11201" r="3" c="S"/>
                     <p ID="P11202" r="3" c="S"/>
                     <p ID="P11203" r="3" c="S"/>
                     <p ID="P11204" r="3" c="S"/>
                     <p ID="P11206" r="3" c="S"/>
                     <p ID="P11209" r="3"/>
                     <p ID="P11215" r="3" c="S"/>
                     ...
                     ... 18.000 elements
                     ...
                     <p ID="P11209" r="3"/>
                     <p ID="P11215" r="3" c="S"/>
           </prefixos>
</tarifador>


Thanks in advance.

Best regards,

Paulo Pizarro

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





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