[jdom-interest] JDOM Document size

Brett McLaughlin brett at newInstance.com
Thu Feb 8 21:13:10 PST 2001


Officially, System.gc() only lets the VM know that garbage collection
"should" be performed now. It is a suggestion, and entirely up to the VM and
threading mechanism as to do anything about it. In other words, as Jason
says, don't count on it doing anything, and if it does, it won't do it all
the time, on all VMs :( IMO, they should have left the method out of the
API...

-Brett

> -----Original Message-----
> From: jdom-interest-admin at jdom.org
> [mailto:jdom-interest-admin at jdom.org]On Behalf Of Jason Hunter
> Sent: Thursday, February 08, 2001 8:44 PM
> To: Matthew MacKenzie
> Cc: quasar at b0b.com; jdom-interest at jdom.org
> Subject: Re: [jdom-interest] JDOM Document size
>
>
> 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-
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yourad
dr at yourhost.com




More information about the jdom-interest mailing list