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

TableView leaks memory



    • Bug
    • Status: Closed
    • P3
    • Resolution: Fixed
    • 7u6
    • 7u6
    • javafx
    • JDK 7u3, JavaFX 2.2b11


      Despite the effort in RT-13965 and RT-15809, TableView (or more likely, VirtualFlow) still appears to leak memory.
      The attached demo illustrates the problem.

      Observed behaviour:
      When running the demo, I use the buttons to add columns to the UI and remove them afterwards.
      Via an attached profiler, I trigger garbage collection and inspect the memory consumed.
      The profiler shows that despite the application returning to its original state, with only an empty table shown, the amount of memory rises with each iteration of "add columns - remove columns - collect garbage".
      Since the application doesn't hold any objects apart from the TableView, this implies a memory leak in the control. The profiler's heap analysis implies that the actual culprit is the VirtualFlow, as it is the largest object by far. This is corroborated by the fact that the problem does not occur when the TableView is empty, that is, holds not items and shows no cells.

      Expected behaviour:
      The application's memory footprint should not change significantly once all classes are loaded and it is returned to the original state.

      I've seen the recent commit[1] "RT-20300: TableView is not refreshed when TableColumn are added dynamically", but I can't access RT-20300 to determine whether it is related or might even fix the problem.

      [1]: http://hg.openjdk.java.net/openjfx/2.2/master/rt/rev/ced2772737ea




            jgiles Jonathan Giles
            ureupkejfx Urs Reupke (Inactive)
            1 Vote for this issue
            2 Start watching this issue