|
Dear Mr. Deweese,
I got a
similar problem with that you answered ("Losing memory when
using removeChild()"). I used
_javascript_ function to simulate HTML <a> tag by loading an SVG file to update only part of the screen (within the scrollpane). Basicly, I modify the openlink() function in JSVGComponent from JSVGComponent.this.loadSVGDocument(href) to
removing current image, creating a new image and displaying it in the
scrolling area.
I used two svg
file for test. Each of them takes around 100 times to get an OutOfMemoryError if
I just reload these files. If I don't load anything and just
call my _javascript_ function to manipulate the DOM tree (generate
and remove scrollbar elements, remove children from svg element, create new svg
and g element, and insert them into new svg element), it takes around
20 reloads to get the OutOfMemoryError. While I traverse from
one image to another, it takes only 4 times to get that error. After I
create the image, I need to reload to regenerate the scrollpane. The code I am
using
try
{
updateManager.dispatchSVGLoadEvent(); } catch (Exception ie) { ie.printStackTrace(); } Could you give
me some suggestions about how to release the memory resource during reloading?
Thank you very much.
With best regards,
William
|
