RE: JDOM output buffering question

"Gamble, Wesley (WG10)" <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
The reason that I asked my original question was because I was seeing my
memory increase by 200MB and then not get released when my document was
written, and the method that created it exited.

 

I came upon this thread from a few years ago:

 

http://osdir.com/ml/java.jdom.general/2005-11/msg00041.html

 

which claims that the SAXBuilder is holding onto a reference that keeps
the document memory from being freed.

 

Can anyone corroborate this and explain a workaround or JDOM upgrade
that might work?  We are on JDOM 1.0 - is this resolved in 1.1?

 

The statement in that thread that says "The document won't be available
for garbage collection until the next parse begins."  is interesting to
me - I am never parsing, just writing.  So maybe this is also a bug on
the "way out" as well as on the "way in"?

 

Also, I didn't quite understand this statement (from Elliotte's reply):
"Even if you can't set it to null, but you could set it to a different
ContentHandler that doesn't have a reference to anything. DefaultHandler
would work nicely for this."

 

It seems like my trouble may stem from keeping the SAXBuilder object
around as a class variable.

 

What if I allow my SAXBuilder to be an instance variable, won't its
garbage collection allow for the garbage collection of everything it's
holding?

 

 

 

Thanks,

Wes

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.