|
From: Andy D. (JIRA) <no...@at...> - 2007-10-10 22:21:01
|
[ http://opensource.atlassian.com/projects/spring/browse/RCP-492?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andy DePue closed RCP-492.
--------------------------
Resolution: Fixed
Fix committed (revision 1822). The overlay will be removed from the JRootPane's JLayeredPane when the target component is removed from the JRootPane's hierarchy. Fix includes regression test.
> OverlayHelper causes memory leak
> --------------------------------
>
> Key: RCP-492
> URL: http://opensource.atlassian.com/projects/spring/browse/RCP-492
> Project: Spring Framework Rich Client Project
> Issue Type: Bug
> Components: Binding System
> Affects Versions: 0.1.0, 0.2.0, 0.2.1, 0.3.0
> Reporter: Andy DePue
> Assignee: Andy DePue
> Fix For: 0.3.0
>
>
> OverlayHelper causes a memory leak as follows:
> 1. When it is attached to a component, it finds an "overlay capable parent" of the component. In newer versions, this is always the JRootPane of the window. In older version of Spring Rich, the leak would surface when the component was not placed in a scrollpane.
> 2. It adds the overlay component to the JLayeredPane of this JRootPane.
> 3. It adds a listener, which happens to be an inner class, to the overlay component. Because the listener is an inner class, it maintains a hidden strong reference to the surrounding OverlayHelper instance.
> 4. The surrounding OverlayHelper instance holds a reference to the component receiving the overlay. This component is part of the form, so there is now a chain of strong references going from the JRootPane of your main window all the way to your whole form UI component hierarchy.
> 5. Close or navigate away from the form. Remove all references to the form. Think you are done with it and surely it will be GCed.
> 6. There is no code in OverlayHelper to remove the overlay from the JLayeredPane once the form is removed from the window, so not only does the JLayeredPane become cluttered with overlays, it also maintains strong references to all your form UIs.
> Note, if you never dispose of your form UIs, and reuse them (keeping them all in memory once loaded), then this probably isn't an issue for you. Otherwise, you eventually run out of memory.
> I'm going to look into fixing this myself, by having the OverlayHelper remove the overlay once the component it is attached to is removed from the JRootPane hierarchy.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/spring/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|