-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hello batik-users!

i solved my problem. another part of my application which executes the
svgloader.loaddocument() and generates the svgdocument object kept a
record of all loaded documents (probebly for caching). the jscgcanvas
kep some references to those documents and therefore was not collected
correctly. after removing this "cache" it worked fine. memory
consumption is down to a frightning low level. ;-)

cheers,
marc

Marc Doerflinger wrote:
> hello batik-users!
> 
> when i load a svg document into the jsvgcanvas through the setDocument()
> method a lot of instances of classes in org.apache.batik.gvt.* are
> created (in my case multiple thousand).
> When i load another document onto the same canvas, those gvt elements
> are not disposed, they stay in the memory. garbage collection does not
> collect them. i think if i load the same document again, no new ones are
> created, but since i load a lot of different documents, this is would be
> a major memory leak.
> is there a way to correctly unload a svg document from the canvas so i
> can reuse it without instantiating a new one? setDocument(null) displays
> an empty canvas again, but i does not clean up the gvt object. is there
> a way to get rid of them? maybe something like a clean up or garbage
> collection for unused gvt elements?
> removing and reinstantiating the jsvgcanvas would be insanly complex,
> since (as i mentioned in mails before) i use the svgcanvas within a swt
> app and the swt-awt bridge has some issues with cleanly removing awt
> objects, so i try to reuse objects whenever possible to avoid memory leaks.
> 
> thanks,
> marc

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



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGbrE36mRZxtk0FrcRAlsxAKC0lAjnbjipwTgy/rmVU3eLJJIz/gCfd+aZ
bCn3HtYkIU3kpMUMNedW5eI=
=uhq1
-----END PGP SIGNATURE-----

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

Reply via email to