[jdom-interest] Persisting a JDOM for later use

Dennis Sosnoski dms at sosnoski.com
Sun Oct 7 09:51:21 PDT 2001


Hi Tapan,

There are at least three choices available for persisting a JDOM. Java serialization
is probably the easiest - just create the ObjectOutputStream, serialize and close -
but also the poorest performing. XML text is a little more of a nuisance to generate,
but is *the* standard for XML and much faster than Java serialization.

The third (and newest) alternative is XML Stream (XMLS), a technique I announced on
this list for JDOM about a week ago. XMLS is faster than text document generation,
but not necessarily great for long-term persistence (formats are subject to change
until production release, so if you write a document with the current release there's
no guarantee you'll be able to read it using the next release).

You can get full details on XMLS here:
http://www.sosnoski.com/opensrc/xmls/index.html Test results vs text and Java
serialization are here:  http://www.sosnoski.com/opensrc/xmls/results.html

As for the document size you can have in memory, I can tell you that the memory size
in bytes looks to generally be about 4 times the text document size. If your system
has 64M available you probably could work with documents up to about 16M of text.
This is a rough figure, though.

  - Dennis

Tapan Nanawati wrote:

> Hi all
> I make a soap call and get a return literal XML. I
> convert it to a JDOM Tree. I make some manipulations
> and extract data from that tree.
>
> Now since the data is a large amount of data, I dont
> want to waste my soap call and want to store the
> resultant JDOM tree for future use.
>
> # First: How can I persist my JDom tree
> # Second: How big a JDOM tree I can I have in memory
> without performance problems. (Any idea would do : for
> eg. size in kb of the data  that can be put to JDOM
> tree without performance issues)
>
> Thanks
> Tapan Nanawati
>
> __________________________________________________
> Do You Yahoo!?
> NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
> http://geocities.yahoo.com/ps/info1
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com




More information about the jdom-interest mailing list