On 2/22/16, 12:24 AM, "XaviConde" <javier.co...@gruposame.com> wrote:
>Hi Alex, > >I'm analyzing a simple case, where an About popup dialog is closed but >several of the objects used are still in memory. > >In this case, the About class inherits from TitleWindow, which inherits >from >UIComponent. I take memory snapshots before opening the popup and after >closing it. I can see an instance of the class still in memory according >to >Loitering Objects. When I inspect the Object References to it, there are >several Function objects created from addEventListener(). Three of these >Function objects were created from UIComponent, as seen in the Allocation >Trace window. So, my understanding is that there are 3 Function objects >which reference my About object, and in order to free them, they should be >destroyed with a removeEventListener() by UIComponent. Is that right, or >they won't be counted as references by the garbage collector...? They won't be counted by the GC. When analyzing references, the only ones that matter are ones that lead away from the object towards another object that isn't in turn referenced by a chain leading to a GC Root. And sometimes it is the children of a dialog that have the reference chain back to GC Root. If you want, you can post links to screen snapshots of the profiler output and we can try to help you decipher it. Make sure there aren't any company confidential class names in the screenshots before you post them. You can obfuscate them if you want. -Alex