You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by paddy <pa...@hotmail.co.uk> on 2006/11/30 16:46:28 UTC

Releasing memory used by SVG Document

I have a problem whereby i have a set of system tabs and my software draws
the relative system in an svg document when the appropriate tab is clicked.
However it seems to have a huge memory leak in that everytime i click on a
tab and thus draw a new document the heap memory being used goes up by 10mb.
I have narrowed it down to the drawing of the new document and i believe it
is not releasing the memory of the old one.
I have read about removing the event listeners but dont know how to do this.
Has anyone got a fixed process which outlines what needs to be nulled etc
when deleting a document?
-- 
View this message in context: http://www.nabble.com/Releasing-memory-used-by-SVG-Document-tf2732435.html#a7621731
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: Releasing memory used by SVG Document

Posted by paddy <pa...@hotmail.co.uk>.
im drawing it in the same canvas as the old one. To save memory i only draw
the document when its relative tab is clicked. Im currently nulling all the
nodes, then nulling the document then drawing the new one but it still seems
to eat 10mb every time i change systems. Any ideas about what i may not be
doing that I should be?
-- 
View this message in context: http://www.nabble.com/Releasing-memory-used-by-SVG-Document-tf2732435.html#a7637610
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: Releasing memory used by SVG Document

Posted by th...@kodak.com.
Hi Paddy,

paddy <pa...@hotmail.co.uk> wrote on 11/30/2006 10:46:28 AM:

> However it seems to have a huge memory leak in that everytime i click on 
a
> tab and thus draw a new document the heap memory being used goes up by 
10mb.
> I have narrowed it down to the drawing of the new document and i believe 
it
> is not releasing the memory of the old one.

   Are you drawing the new document in the same canvas as the old 
document?

> I have read about removing the event listeners but dont know how to do 
this.
> Has anyone got a fixed process which outlines what needs to be nulled 
etc
> when deleting a document?

   Unless you have attached your own listeners to the DOM
(EventTarget.addEventListener), you don't need to remove anything.
The Canvas/Batik will drop all of it's internal references to the 
old document when you load a new document.  However since you
mention 'tabs' I wonder if you don't end up with a Canvas under
each tab.  In which case you will need to remove the Canvas from
the other tabs (or set the displayed document to 'null').


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