chandrashekar srinivasan wrote:

1) I have a svg document which when rendered onto the JSVGCanvas takes up lot of memory.

Do you know why it takes up lots of memory?

I need to display the document only when a user invokes a menu item. Is there any way I could keep the document object bound to JSVGCanvas but only render when I show the canvas. again when the canvas is closed, free some memory. anything I could do with staticrenderer?

One of the larger chunks of memory for the canvas is it's offscreen buffer (it may have two if you have double buffering set). If you shrink the canvas size I think the offscreen buffers will shrink as well. Ideally if you rendered statically you could drop the DOM completely and just keep the GVT tree. This doesn't quite work in practice because Text keeps a reference to the DOM in order to resolve SVG Fonts (which is done at render time - for a variety of reasons). If you didn't care about this you could probably 'fix' this locally.

2) also what is the best way to reduce/erase memory footprint for a document loaded in JSVGCanvas, if I don't care for caching. also I keep loading diffferent documents onto the canvas one after the other.

First off you should be using Batik 1.6 there were at least two significant memory leaks that were fixed in this area.

   With Batik 1.6 I don't think there is much to do the 'cache' of
documents uses Soft References so under memory pressure the cached
documents will be dropped from the system.  Really the thing to do
is profile things a bit and if you notice something that doesn't
look right to you post it to this list and we can see if there is
an opportunity to reduce memory usage.

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



Reply via email to