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

Indeterminate progressIndicator cause MemoryLeak

XMLWordPrintable

    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10

      A DESCRIPTION OF THE PROBLEM :
      Indeterminate progressIndicator cause memoryleak when used inside a placeholder of a treetableview

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1 Run the attached app
      2 Click open leaky dialog
      3 Close it
      4 Repeat step 2 and 3 several times


      Open a memory profiler and look for stage or progress indicator



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      It should stay only one stage and no progress indicator
      ACTUAL -
      There is as many stage as the number of times you click leaky button

      ---------- BEGIN SOURCE ----------
      /*
       * To change this license header, choose License Headers in Project Properties.
       * To change this template file, choose Tools | Templates
       * and open the template in the editor.
       */
      package javafxbug;

      import javafx.application.Application;
      import static javafx.application.Application.launch;
      import javafx.event.ActionEvent;
      import javafx.event.EventHandler;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.ProgressIndicator;
      import javafx.scene.control.TreeTableView;
      import javafx.scene.layout.StackPane;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      /**
       *
       * @author Cyril FISCHER
       */
      public class ProgressIndicatorMemoryLeak extends Application {

          @Override
          public void start(Stage primaryStage) {
              Button btn = new Button();
              btn.setText("Open Leaky Dialog");
              btn.setOnAction(new EventHandler<ActionEvent>() {

                  @Override
                  public void handle(ActionEvent event) {
                      Stage stage = new Stage();
                      TreeTableView treeTableView = new TreeTableView();

                      //
                      treeTableView.setPlaceholder(new ProgressIndicator(-1.0)); //Root Cause of memoryLeak : indeterminate cause leak otherwise no
                      //
                      stage.setScene(new Scene(new VBox(treeTableView)));

                      stage.showAndWait();
                  }
              });

              StackPane root = new StackPane();
              root.getChildren().add(btn);

              Scene scene = new Scene(root, 300, 250);

              primaryStage.setTitle("Hello World!");
              primaryStage.setScene(scene);
              primaryStage.show();
          }

          /**
           * @param args the command line arguments
           */
          public static void main(String[] args) {
              launch(args);
          }

      }

      ---------- END SOURCE ----------

      FREQUENCY : always


            arapte Ambarish Rapte
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: