[jdom-interest] JDOM Document size
    Jason Hunter 
    jhunter at collab.net
       
    Wed Feb  7 18:28:38 PST 2001
    
    
  
> I was faced with a similar problem.  Instead of caching the JDOM Document, I
> opted to read it into a serializable Java class.  This worked very well and
> is very fast.  The resulting bean is smaller than the source XML.
It's tricky to judge how much memory a document takes.  It's a feature I
wish OptimizeIt had.  I suspect that the size of a serialized Document
object would be rougly equivalent to its size in memory.  Anyone know
for sure how closely they relate, or have a good trick for judging the
memory usage of an object and its members?
BTW, it's theoretically possible for a serialized document to be smaller
when serialized than in its original XML source, because long strings
like "this_long_element_name" are intern'd and thus need only be
represented once in the output.  Plus if your file encoding is UCS-2
you'll save because serialization presumably uses UTF-8.  I'm not saying
I expect serialization will be smaller, but that it's possible.
-jh-
    
    
More information about the jdom-interest
mailing list