Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XOM memory usage

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Marcus Downing <marcus AT minotaur.it>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XOM memory usage
  • Date: Wed, 26 Sep 2007 20:05:17 -0400

Marcus Downing wrote:
I've successfully used XOM on many reasonable-sized documents. Now I
need to parse a 10Mb xml document, and the memory usage is just too
much.

I manage to process about 90% of the elements before hitting an
OutOfMemoryError, which suggests that something is a being assigned
and held onto as each element is parsed. Is there anything I should be
doing to minimise the memory use or release elements which are no
longer needed?


Like most tree models, XOM sucks the whole document into memory and holds onto it. You can't release it in pieces. That said, 10MB should be well within its capabilities on any modern hardware. Have you profiled it to see where the memory is going?

You can process documents larger than available memory but you need to use a NodeFactory. See the FAQ at

http://xom.nu/faq.xhtml#d0e286


--
Elliotte Rusty Harold elharo AT metalab.unc.edu
Java I/O 2nd Edition Just Published!
http://www.cafeaulait.org/books/javaio2/
http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/




Archive powered by MHonArc 2.6.24.

Top of Page