xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject RE: Memory & Dynamic Canvas
Date Mon, 08 May 2006 22:12:26 GMT
Hi Greg,

"Greg Steele" <gsteele@apt-cafm.com> wrote on 05/08/2006 05:02:07 PM:

> Thanks for the tip, but it seems about the same.  I'm using Netbeans 5.0
> with the profiler plug-in and INSANE to monitor the heap.  Garbage
> collection is great with a static canvas, but when the canvas is 
switched to
> dynamic, garbage collection seems to break down. 

   I'm not sure what this means. What version of Batik are you using?
The first thing I would try is 'trunk' if that doesn't work you might
try 'branches/svg11' (more stable but will eventually be deprecated).

> I'm loading some pretty big svg files(building cad) that are around 
2.5Mb. 
> My understanding of gc could be better, but something doesn't seems 
right 
> if the problem goes away by commenting out one line of code
> (canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC)).

   The canvas uses a bunch more memory to manage the dynamic link
between the document and the rendering tree when you set it for DYNAMIC.
The simple fact that it uses more memory isn't it's self an indication 
of a problem.

   Is there a reason you don't keep the same canvas and give it a
new SVG to display?

> Try
> canvas.flush();
> canvas.flushImageCache();
> 
> in your dispose code.
> 
> Greg Steele wrote:
> > Hi,
> > 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.
> >
> > Unfortunetly, I need the canvas dynamic.  Forgive me if this has been
> > addresses elsewhere, but I scoured the mailing list for a fix.
> >
> > Thanks,
> > Greg
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: 
batik-users-help@xmlgraphics.apache.org
> >
> >
> >
> 
> 
> --
> David Avery
> Front Gate Tickets
> 1711 South Congress Austin, TX 78704
> Ph: 512-674-9364
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message