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

TreeCells leak and aren't re-used

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 7u40
    • Fix Version/s: 7-pool
    • Component/s: javafx
    • Environment:

      Windows 7 64-bit
      Java 7u40

      Description

      In 7u40 (not an issue with JavaFX 8) excessive TreeCells are created rather than having existing cells reused.

      This makes it awkward to disconnect listeners, e.g. a reasonable pattern might be:

      protected void updateItem(NodeData t, boolean empty) {
      super.updateItem(t, empty);
      if (!empty && t != null) {
      connectListeners();
      } else {
      disconnectListeners();
      }
      }

      but with 7u40 the listeners will never be disconnected, and the cell will leak.

      Another phenomenon observed is that TreeCells that are no longer used remain connected to the Scene until the TreeView is resized (there may be other events that trigger their release). Thousands of unused TreeCells can accumulate over time. Not only does this make it even harder to disconnect the listeners at an appropriate time, but each TreeCell may of course have references to other large objects.

        Attachments

          Activity

            People

            • Assignee:
              jgiles Jonathan Giles
              Reporter:
              swpalmer Scott Palmer
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: