Thomas DeWeese wrote:
>> Our application animates an SVG document by adding and removing
>> nodes, and also by modifying node attributes. A mouse listener
>> is alwyas added to newly added nodes - and the same listener object
>> is added every time.
> 
>    But this listener is your listener not a "bridge context listener".
> I hope you aren't registering it with the BridgeContext are you?

No.. you are right, this "reused listener" thing is a red herring.
I didn't realize the listeners were different.

>> I've checked that we are removing the nodes that we add, so that
>> we're not just growing the document itself.
> 
>    Are you certain that the nodes you remove are going to GC?
> I suspect they are not (this may be a Batik problem or it may
> be a problem in your app).  Note that this can't be a Memento
> problem since it uses soft references.

I picked a random memento and looked at what it was referencing.
It pointed to a <g> node that is the rererent of a <use> node
(i.e., the <g> node contained stuff that is in the <defs> section).

Note that one thing my application does is change the "xlink:href"
attribute on existing <use> nodes to point them at different symbols.

Perhaps there is some leak where Batik retains a reference to the
previously pointed-to <use> referent?

My application holds a reference to the <use> node of course, but
it never references the referent of the <use> node (it lets Batik
figure that out via the "xlink:href" attribute). So I know for certain
that I'm not holding a direct reference to the referent of the <use>.

E.g., does Batik remove its reference to the previously-referred to
node when the "xlink:href" attribute changes?

>> The objects that accumulate in my heap are never-freed are instances
>> of BridgeContext$EventListenerMemento. These instances remain in the
>> BridgeContext instance field "eventListenerSet", causing this set to
>> grow in size until memory is exhausted. In our application, this takes
>> a couple of days to occur.
> 
>    What type of objects are you adding/removing?  Text/use/image?

I'm adding mostly <use> references to pre-defined icons and text.

>    But if you remove nodes from the DOM and keep no references from
> your code the 'old' nodes should go to GC and the memento should go
> away.

Agreed..

Thanks again for your help.

-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com


*
Confidentiality Notice: This e-mail message, including any attachments, is for 
the sole use of the intended recipient(s) and may contain confidential and 
privileged information. Any unauthorized review, use, disclosure or 
distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message.
*


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to