i've been making an application and i've been tracking its memory usage. The app's memory is about 58,676 K as seen below.
This is my GUI.
That close button there has a function that makes that panel not Visible.
private final ActionListener closeButtonAL = new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
timeUtilities.getPanel().setVisible(false);
}
};
I also have a button that makes the panel visible again.
private final ActionListener showPanelAL = new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
timeUtilities.getPanel().setVisible(true);
}
};
The panel has been initialized already before the app starts showing.
My problem is that, by just making the GUI appear and closes it again and again increases the memory usage of the application.
Isn't this some sort of memory leak? Regardless of the answer, how do I prevent this matter?