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

Memory leak in ProgressBar and ProgressIndicator in case group.clear() is not called

XMLWordPrintable

      There is memory leak in ProgressBar and ProgressIndicator in case these controls
      are added into group for which group.clear() is not explicitly called.

      The core issue seems to be the same as it was in RT-16183.
      com.sun.javafx.tk.desktop.MasterTimer:receiverList which contains AnimationPulseReceiver objects is not cleared.
      As result ProgressBar, ProgressBasrSkin and other
      objects are not garbage collected which lead to OOM.

      To demonstrate the problem run attached ProgressBarMemTest2:
      > javac -cp "JFX/rt/lib/jfxrt.jar ProgressBarMemTest2.java
      > java -Xmx16m -verbose:gc -cp "JFX/rt/lib/jfxrt.jar;." ProgressBarMemTest2

      Comment out lines [58-62] in ProgressBarMemTest2.java to see that there is no mem leak in
      case we call group.clear();
       
      See also heap histogram and root path to AnimationPulseReceiver in attached ProgressBarMemTest2_2844_16m_histogram.JPEG

      This memory leak leads Ensemble to fail with OOM after clicking on ProgressBar and
      ProgressIndicator samples 30 times (in case the heap is 64mb). I will file Ensemble bug
      as well to propose the workaround in case this bug will not be fixed in Presidio.

            miflemi Mick Fleming
            epavlova Ekaterina Pavlova
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: