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

Memory leak in Parent when children list cleared and repopulated

    Details

      Description

      While analyzing my FX 2.0 app for memory leaks, I noticed that VBox will leak memory through what must be a private variable called "bottom". My scenario is as follows: My application contains a VBox that is populated by a series of nodes. Occassionally, the user does something in the app that requires me to flush all of the nodes currently in the vbox and replace them with new stuff. Previously, I was doing this by calling VBox.getChildren().clear() and then adding the new stuff to the existing instance of VBox. However, this was causing the leak so I had to change my code to create a new VBox every time the list required refreshing.

      I could probably come up with a sample app for reproduction, but I'm hoping this explanation is fairly succinct. It seems like the variable "bottom" and possible some others should be cleared if the node in question gets removed (either via the clear() or remove methds...).

      Thanks,
      Kyle

        Attachments

          Activity

            People

            • Assignee:
              psafrata Pavel Ĺ afrata
              Reporter:
              kmcintyrejfx Kyle McIntyre (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: