Hi all,
I have encountered an out of memory problem when using a JSVGCanvas in an applet. When page starts browser calls init() and then start() methods of JApplet. Once started I can cycle between lot of heavy svg document without having any memory problem. When free memory goes down GC correctly starts and frees memory. The problem occurs when you press browser’s reload button. Browser calls destroy() applet method in which I flush JSVGCanvas image cache. (Or should I do anything else?) Then page is reloaded, browser recall init and start but when cycling through SVG GC can’t collect memory allocated during first applet execution. At the third execution (pressing again browser reload button) SVG loading become very slow and finally java console writes the “Out of Memory” message.
In applet I allocate only few objects while JSVGCanvas loads heavy documents (1000 png etc) It seems that before subsequent applet execution VM isn’t resetted and object allocated during first execution are still present in memory but they can’t be deallocated because (I think) , the subsequent execution’s GC can’t reach object allocated during first execution.
Where is the problem? What can I do to avoid this behaviour? Any idea?
Thanks in advance.
Bye
Stefano. |