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

Adding a tooltip causes memory leak

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Cannot Reproduce
    • Affects Version/s: fx2.0
    • Fix Version/s: fx2.0
    • Component/s: javafx
    • Labels:
    • Environment:

      EA build 25, Windows XP

      Description

      I've noticed that if I add a tooltip to an FX control and then trigger that tooltip at runtime (by hovering over it), it induces a memory leak which in my case is quite large because of the tooltipped control's parent reference. Attached is a sample application that will hopefully demonstrate the problem if you go through the following steps:

      - Run the app
      - Hover over the textbox and trigger the tooltip to appear
      - Click the button to remove the textbox from the scene. At this point there should be no remaining references to the textbox.
      - Garbage collection (hopefully) runs

      After going through this process, dump the heap and analyze it. You'll notice that the textbox is still in memory because of a reference chain similar to the one in the attached image from Eclipse MAT. This leak is potentially very serious because anything referenced by the parent of the textbox will be retained in memory. Note that if you skip the step where you hover on the control and trigger the tooltip popup, that the TextBox instance is not retained in memory.

        Attachments

          Activity

            People

            • Assignee:
              lnerad Ľubomír Nerád
              Reporter:
              kmcintyrejfx Kyle McIntyre (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: