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

Jason Hunter jhunter at servlets.com
Tue May 22 09:50:13 PDT 2007

What do you mean that you increased virtual memory?  In Java the best 
thing to do is increase the heap size.

java -Xms128m -Xmx512m Foo

Maybe you have more than 512M to throw at the problem.  If that doesn't 
work, then you can change your code to write elements at a time and let 
them GC so you won't run out of memory.  You just need to do a little 
manual work for the root element wrapper.


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