I looked into BaseChart source, and found that nativeDestroy is called in overiden onUnload , which is called in Widget's onDeatach. I didn't test this in core gwt widgets, but I have debugged it with smart gwt and nativeDestroy is never called when I try to remove member from parent canvas container , or when i close smart gwt tab.
This causes memory to grow in apps that needs to create and destroy a lot of charts , or apps like showcase .
Any idea of how to solve this issue ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How are you trying to destroy the SmartGwt widgets? Removing them from a parent and/or closing a tab won't do it if I remember correctly unless you have some option set in the widget to do so.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, I didn't test smart gwt widgets/canvases, but i dont beleive there would be memory leak if you open 100 tabs and close them. Their showcase is working well . But if you have charts in that tabs, and close them, memory will remain the same (or if you remove charts programatically).
I made some workaround to manually call chart native destroy when removing chart's wrapper canvas or closing tab , and that slowed down memory build up.
public static native void nativeDestroy(JavaScriptObject chart) /*-{
chart.destroy();
}-*/;
nativeDestroy(gwtChart.getNativeChart());
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I looked into BaseChart source, and found that nativeDestroy is called in overiden onUnload , which is called in Widget's onDeatach. I didn't test this in core gwt widgets, but I have debugged it with smart gwt and nativeDestroy is never called when I try to remove member from parent canvas container , or when i close smart gwt tab.
This causes memory to grow in apps that needs to create and destroy a lot of charts , or apps like showcase .
Any idea of how to solve this issue ?
How are you trying to destroy the SmartGwt widgets? Removing them from a parent and/or closing a tab won't do it if I remember correctly unless you have some option set in the widget to do so.
Well, I didn't test smart gwt widgets/canvases, but i dont beleive there would be memory leak if you open 100 tabs and close them. Their showcase is working well . But if you have charts in that tabs, and close them, memory will remain the same (or if you remove charts programatically).
I made some workaround to manually call chart native destroy when removing chart's wrapper canvas or closing tab , and that slowed down memory build up.