[jdom-interest] JDOM parser reuse memory problem

Rolf Lear jdom at tuis.net
Thu Nov 17 09:13:41 PST 2011

On 17/11/2011 11:51 AM, BIHANIC Laurent wrote:
> Le 17/11/11 17:33, Rolf Lear a écrit :
>> There is a bug though, and it could explain some confusion.
>> The problem is the the XMLReader has had it's various handlers set to the
>> SAXHandler (Content, DTD, Error, etc.) and when you re-use the XMLReader, you
>> in effect keep a reference to the SAXHandler.
>> Setting the SAXHandler to null at the end of the build does not cause the
>> XMLReader to forget it's handlers.
>> It is an issue that Randall identified a week or so ago.
> OK. So maybe we should explicitly reset the Document reference in SAXHandler
> (by adding a call to a protected method in the finally clause) and remove this
> old fix.
> Regards,
> Laurent
> --

When Randall alerted us to the issue I filed an 'issue' for it. There 
are a few options that have already been suggested, and it will take 
some experimentation to figure out which one is the best (or if there 
are other options). I just have not yet gotten around to it. It needs 
more time/investigation though to get the right solution.

On the other hand, this back-and-forth has inspired me to update the 
issue with the suggestions-so-far: 


More information about the jdom-interest mailing list