[jdom-interest] JDOM Document size

Jason Hunter jhunter at collab.net
Thu Feb 8 18:44:00 PST 2001


Matthew MacKenzie wrote:
> 
> It might be possible to guage the size of a DOM rather unscientifically by
> first running the program with a very simple xml file, such as <doc />,
> recording the
> memory footprint, then running a more complex document with a wide variety
> of components
> (attributes, elements, cdata, etceteras) and also recording its process
> size.  Subtract a from b and
> you should have a really rough estimate.

That approach suffers from the problem that all temporary objects
created during the build will be represented despite the fact they're
not in the document.  You might try a System.gc() but we've found here
before that it doesn't really do a full gc, if it does a gc at all. 
(Testing on JDK 1.2.2 Windows shows System.gc() does nothing.)

-jh-



More information about the jdom-interest mailing list