Hi,
I use JSVGCanvas in an applet to show SVG diagrams. When the page is
navigating away from the current page, I disposed the canvas in the applet
stop method. I earlier had:
canvas.dispose();
I have many pages each with an applet in it, with the SVG diagram, and
users can switch between these pages, sometimes quite rapidly. I noticed
there was memory leaking away. I then included a call to stopProcessing,
which improved things. So I now have
canvas.dispose();
canvas.stopProcessing();
1. Is this sufficient?
Also, at times during navigation, I see errors such as these logged in the
console (I believe if I navigate away before the SVG is rendered):
java.lang.NullPointerException
at
org.apache.batik.dom.events.EventListenerList.removeListener(Unknown
Source)
at
org.apache.batik.dom.events.EventSupport.removeEventListenerNS(Unknown
Source)
at org.apache.batik.dom.AbstractNode.removeEventListenerNS(Unknown
Source)
at
org.apache.batik.bridge.FocusManager.removeEventListeners(Unknown Source)
at org.apache.batik.bridge.FocusManager.dispose(Unknown Source)
...
(or a null pointer exception at setGraphicsNode) Can these add to a leak,
and can I handle these somehow?
Thanks,
Praveen