[jdom-interest] Java heap space error, please help.

Jason Winnebeck gillius-ml at gillius.org
Tue May 22 08:23:13 PDT 2007

DOM is a cached memory model for document that holds the whole document in 
memory for random access, therefore DOM-based APIs such as JDOM will never be 
sufficient for your task. If you want to stream XML on output you'll have to 
use a different API such as SAX. Or, to be honest, if the output XML file is 
simple enough and a fixed format you could just write it yourself using 
standard file IO streams. XML parsers are a lot more difficult to write than 
XML writers.


Rustican wrote:
> I'm using the jdom package to create an xml export file for an Oracle 
> database i'm running.  Unfortunately it is a very large database and 
> the export is apparently trying to read everything into memory before it 
> writes to the file causing a out of Java heap space error and no data 
> written to the file.  I've tried increasing virtual memory allocation 
> but i'm still hitting the error.
> Is there anyway to have the export write to the file as it is pulling 
> data from the database?  Or write data to file in chunks instead of the 
> whole thing at once?
> Thanks.
> Rustican
> ------------------------------------------------------------------------
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com

More information about the jdom-interest mailing list