Hi Liutcpeter, liutcpeter wrote: > We've been using Batik to create interactive visualization tools > in Java. One issue we have is about Batik's memory footprint > and that is may not scale. Specifically, the scenario we are worried > about is when there are a large number of svg canvases (50-100) open > each displaying a set of visual objects.
That is a fairly large number. I hope the graphics are fairly simple? > Although, only one or two canvases need to be visible at a given time, > the users need to be able to quickly switch among the canvases. > Clearly, we have to be smart about memory management. So, first, I > would like to know if there is any recommendation for how to optimize > memory usage for batik in general. Nothing real specific, filters can use a bit of memory. Aside from the actual graphics probably the largest memory sink is the offscreen buffer(s) for the Canvas. In particular the canvas can be single or double buffered. You probably want single. > In addition, I would like to know if there is any way > to quickly free up memory for a canvas that has become hidden > and be able to quickly switch back to it. Well this is really a question of how much you want to free up vs how fast you want to switch back. The first thing to get rid of is the offscreen buffer (or anyway perhaps size the window to 1x1). Then you could dispose of the GVT rendering tree rebuilding the rendering tree isn't that time consuming but for complex text/strokes the first rendering can take some time. For static content you may have the option of just using the JGVTComponent and dropping the SVG DOM tree. BTW you may find the Batik-Users list a little better source for this sort of information. ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/