ActionListeners linger on after closing the internal frame
I am working on a relatively large Java software package which implements GUI and various algorithms to perform computations in imaging related research. This package uses internal frames. There is a problem in that the memory size keeps growing when a internal frame is opened and closed by the user. The internal frame has menus. These menus have components which register various action listeners. The problem is that, after the internal frame is closed, certain types of action listeners linger on, leading to an increase in the memory size. These action listeners implement the Action class (abstract action). Effectively here is the inheritance chain:
It is the TAction which is instantiated in a menu class. In the memory profiler, the lives instances of TACtion remains after the internal frame is closed. I have been trying various options to track down the listeners and remove them and have failed. Any general or specific advice as to how to go about solving this problem is appreciated. I am fairly new to Java, but have been programming for long time. Thank you.