My app used the SidePanel menu as navigation and when I show new form or open sidebar panel, the app takes more and more memory. Possible, it depended on using some Image processing (to mask image to circle) in SideBar and a lot of using URLImage class for downloading images. But most likely due to the fact that I did not free memory of the previous form.
How I can free this memory?
Code of changing forms:
public void showForm(FormBuilder form) {
if ( current == null ||
( ! form.getForm().getTitle().equals(current.getTitle()) )
) {
current = form.getForm();
if (!(form instanceof splash)) {
try {
sideMenu.addMenu(current);
} catch (IOException ex) {
}
}
current.show();
}
}
void sideMenu.addMenu(Form form); - Static function for add SideBar menu to form.