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

Ensemble: Memory leak in ProgressBar and ProgressIndicator samples due to RT-16799

    Details

      Description

      There is memory leak in ProgressBar and ProgressIndicator Ensmeble samples
      caused by memory leak in ProgressBar and ProgressIndicator controls (RT-16799).

      Ensemble run with -Xmx64m fails with OOM after clicking on ProgressBar and ProgressIndicator
      30 times. So, this is pretty noticeable memory leak which could lead to OOM pretty quickly.

      It is not clear whether there is a time to fix RT-16799.
      So, I propose to add the following workaround into Ensemble.


      diff -r 8e58578a9bb0 ga-samples/Ensemble/src/ensemble/samples/controls/ProgressBarSample.java
      --- a/ga-samples/Ensemble/src/ensemble/samples/controls/ProgressBarSample.java Wed Sep 07 15:52:13 2011 +0200
      +++ b/ga-samples/Ensemble/src/ensemble/samples/controls/ProgressBarSample.java Wed Sep 07 13:40:45 2011 -0700
      @@ -82,5 +82,10 @@
               
               getChildren().addAll(p1,p2,p3,p4,p5,p6); }
      +
      + @Override public void stop() {
      + // Workaround for RT-16799
      + getChildren().clear();
      + }
       }
       
      diff -r 8e58578a9bb0 ga-samples/Ensemble/src/ensemble/samples/controls/ProgressIndicatorSample.java
      --- a/ga-samples/Ensemble/src/ensemble/samples/controls/ProgressIndicatorSample.java Wed Sep 07 15:52:13 2011 +0200
      +++ b/ga-samples/Ensemble/src/ensemble/samples/controls/ProgressIndicatorSample.java Wed Sep 07 13:40:45 2011 -0700
      @@ -34,6 +34,8 @@
       import ensemble.Sample; import javafx.scene.control.ProgressIndicator;
       import javafx.scene.layout.GridPane;
      +import javafx.scene.Group;
      +import javafx.scene.Node;
        /**
        * A sample that demonstrates the Progress Indicator control in various modes.
      @@ -73,5 +75,13 @@
               getChildren().add(g);
           }
      +
      + @Override public void stop() {
      + // Workaround for RT-16799
      + GridPane g = (GridPane) getChildren().get(0);
      + g.getChildren().clear();
      + getChildren().clear();
      + }
      +
       }




      I have run Ensemble reliability test with proposed workaround and the test passed more than 300 iterations
      without memory leak and memory growth.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dmasada Debra Masada (Inactive)
                Reporter:
                epavlova Ekaterina Pavlova
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: