OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: SAX drivers bug ... or feature !

[ Lists Home | Date Index | Thread Index ]
  • From: Toivo Lainevool <tlainevool@yahoo.com>
  • To: david@megginson.com, XML Developers' List <xml-dev@ic.ac.uk>
  • Date: Sat, 21 Nov 1998 11:02:05 -0800 (PST)






---david@megginson.com wrote:
> 
> Depending on the virtual machine, this could be a killer.  Remember
> that a medium-sized XML document (such as a book) might have 10,000
> elements: that would mean an extra 10,000 attribute lists allocated
> and then garbage collected in what should be only a few seconds of
> parsing.
>

If your worried about the performance of the parser, just setting the
attributeList to null would be faster than doing the
AttributeListImpl::clear() which would cause a removeAllElement() on
each of the underlying member vectors.  If your cranking away with the
parser, chances are the low priority gc task wouldn't be fired while
your doing this, unless you hit your memory limit.

If your worried about memory space,  the clear() and resulting
resulting removeAllAttributes() would allow you to reuse the
AttributeListImpl and Vector objects, but the removeAllElements just
releases their hold on the underlying String within the vectors,
meaning that the Strings, which I assume would count for most of the
memory would be left hanging around for the gc to free anyway.

So which of these approaches would result in a more optimized parser
would highly depend on the size of the document, the amount of memory
you have available, and the gc algorithm your VM uses.

Toivo Lainevool

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS