Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8118555

Memory leak in TreeTableView

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • javafx

      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?

            jgiles Jonathan Giles
            sbozianjfx Shant Bozian (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: