Archie,
Thank you very much. Lesson learned. Removing a swing component from its
parent container is not enough.  Dispose must be called too.  Sorry to
clutter this mailing list with a Swing issue.

Greg

-----Original Message-----
From: Archie Cobbs [mailto:[EMAIL PROTECTED]
Sent: Monday, May 08, 2006 9:07 PM
To: [email protected]
Subject: Re: Memory & Dynamic Canvas


Greg Steele wrote:
> I've been trying to track down a major memory leak in my app.  After
> creating a very simple test app, I was able to determine that setting
> canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC) was somehow causing
> unused objects to remain on the heap after I removed the canvas from the
> container.  The memory leak goes away when I leave the canvas static; I
can
> close and reopen the same SVG doc indefinitely.
>
> Perhaps, I'm not closing the canvas correctly?  Currently, I just remove
it
> from its parent container.

FWIW, my application uses a different JSVGCanvas for each image
displayed and we don't see any leaking memory after loading
several images.

Are you sure that you're not retaining a reference to some object somewhere
that might indirectly reference the JSVGCanvas?

FYI here's what we invoke when discarding a JSVGCanvas object:

         canvas.stopProcessing();
         canvas.dispose();

Try adding one or both of those when you discard to see if that helps...
just a wild guess.

-Archie

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

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



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

Reply via email to