Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

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

Jason Hunter

2007-05-22

Replies:

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.

-jh-

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@(protected)
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.