Re: Java heap space error, please help.

Jason Winnebeck <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
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.

Jason

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/[email protected]
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.