[jdom-interest] Why JDOM is light weighted, but still have the Document in memory?

Dennis Sosnoski dms at sosnoski.com
Thu Nov 1 17:48:24 PST 2001


Hi Daling,

The articles you've read may have been somewhat misleading. JDOM is not 
a light-weight representation.

You can view some actual figures on memory usage for JDOM and several 
other models in my article on IBM developerWorks, at 
http://www-106.ibm.com/developerworks/xml/library/x-injava/index.html - 
Figure 5 has the memory consumption figures. There was also an earlier 
thread on this list discussing these results, the post at 
http://lists.denveronline.net/lists/jdom-interest/2001-October/008455.html 
has the most detailed information in that thread.

  - Dennis

Daling Xu wrote:

> Hi, All
>
> In all the articals talk about JDOM, I always found people saying " 
> JDOM is light weighted, it doesn't require the entire document to be 
> in memory." but at the same time "It provides a full document view 
> with random access".
>
> I really can't understand this. SAX is light weighted and takes less 
> memory because it's event driven, that't also the reason we can't 
> "random access" the elements in the XML file.
>
> DOM mapping the whole XML file into a tree hierarchy so we can have 
> random access but that will take a lot of memory if the XML file is 
> big. That's also understandable because we put all the data in the XML 
> into memory.
>
> To me, JDOM document is very similar to a DOM document, it's collected 
> all the information in the XML file and built into a tree hierarchy, 
> so we can have random access but SHOULD take a lot of memory. I know 
> there must be some thing I misunderstood here, but what is it?
>
> Any one can explain this to me? Or I need some example to "convince" 
> me, say, build a JDOM document and a DOM document from the same XML 
> file, then compare their size, but how to implement this experiment.
>
> Thanks for any information. It's really haunting me.
>





More information about the jdom-interest mailing list