commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Goodwin <>
Subject Re: [digester] Digester pinning objects in memory
Date Wed, 06 Jul 2005 13:13:17 GMT
Thanks for the reply.  Since I have the option of moving to 1.7 I think 
I will.  I'll keep searching for the answer, but it's not immediately 
clear to me how I am holding a reference to Digester since I am 
declaring it locally in a method (so it should go out of scope).  Also, 
I'm a little concerned because the code I wrote is pretty basic and it 
basically follows all the tutorials out on the web.  I'm creating and 
using the digester in the loop and so I'm curious if I'm seeing stuff 
that others aren't because I'm reading multiple files and creating 
objects from them while others are just reading one config file and the 
memory problem isn't manifesting itself.  Following occam's razor though 
your explanation is probably what is really going on.



Simon Kitching wrote:

>On Tue, 2005-07-05 at 16:48 -0500, Matt Goodwin wrote:
>>I am using commons-digester for creating some objects from some xml 
>>files.  When I look at this with JProbe Digester (and some other 
>>internal stuff are still referencing the object that is parsed.  The 
>>code is as follows, any help would be greatly appreciated: 
>Digester does keep a reference to the "root" object it creates. You can
>clear this via a call to:
>  Digester.resetRoot (since 1.7 only).
>I don't see any other way that Digester could retain references to
>created objects.
>However this shouldn't be relevant; after you use the Digester object,
>there shouldn't be any references to it. So the Digester will get
>garbage-collected and therefore the "root" object isn't prevented from
>being garbage-collected. It would therefore appear that your code is
>holding on to the Digester reference after it has been used; if you fix
>this then your problem should go away anyway.
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message