>I'm not sure what the typical overhead of a JDOM structure is (how much RAM it
>takes compared to how much disk-space the equivalent XML would take up), and
>it's application-dependent anyway. Assume, for the sake of argument, that it's
>3:1.
Yes, I'd say that's about right. On the one hand, Java stores Strings
as Unicode, so one character takes 2 bytes - one byte more than on
disk; on the other hand, if you have:
<longxmlelementname>foo</longxmlelementname>
You have to store only two Strings in memory:
longxmlelementname foo
And of course, there's JDOM element overhead. There's the good article
on Java object overhead and memory consumption:
http://www.javaworld.com/javaworld/javatips/jw-javatip130.html
>Under that assumption you'll need around 3 to 15 GB of addressable RAM just to
>hold the JDOM structure. So you will have to be running on a 64-bit JVM before
>you can even consider this.
It seems that the speed limit is the one you hit before the memory
limit. If it takes a hours to fill even 500 MB of memory with XML
data...
>Personally, I would think /very/ hard about why I cannot just build the XML
>incrementally (writing it out to file in one pass without ever holding all the
>data in memory at once). With luck, some thought would show that it is
>possible after all.
Yes, some kind of SAX parser which doesn't load XML to memory would
probably be more appropriate.
Domchi

Signature
Ouroboros ltd. - http://www.ouroboros.hr
Antispam: to reply, remove extra monkey from reply-to address.