-
Bug
-
Resolution: Fixed
-
P3
-
8
I've been profiling my application for memory leaks, and I found that they are originating from the TreeTableView component.
The problem is that a TreeTableView object is never being garbage collected, because it keeps being referenced by treeItemToListMap (static final field of TreeTableViewSkin).
treeItemToListMap is a WeakHashMap<TreeTableView, TreeTableViewBackingList>, and according to the javadoc of WeakHashMap: "The value objects in a WeakHashMap are held by ordinary strong references. Thus care should be taken to ensure that value objects do not strongly refer to their own keys, either directly or indirectly, since that will prevent the keys from being discarded."
But in this case, TreeTableViewBackingList does reference TreeTableView.
Am I missing something?
The problem is that a TreeTableView object is never being garbage collected, because it keeps being referenced by treeItemToListMap (static final field of TreeTableViewSkin).
treeItemToListMap is a WeakHashMap<TreeTableView, TreeTableViewBackingList>, and according to the javadoc of WeakHashMap: "The value objects in a WeakHashMap are held by ordinary strong references. Thus care should be taken to ensure that value objects do not strongly refer to their own keys, either directly or indirectly, since that will prevent the keys from being discarded."
But in this case, TreeTableViewBackingList does reference TreeTableView.
Am I missing something?