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

TextField: memory leak

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2
    • fx2.1
    • fx2.1
    • javafx
    • Win7/JDK6/b07

    Description

      Sample to reproduce:

      /*
       * To change this template, choose Tools | Templates
       * and open the template in the editor.
       */
      package main;

      import javafx.application.Application;
      import javafx.application.Platform;
      import javafx.scene.Scene;
      import javafx.scene.control.TextField;
      import javafx.scene.layout.HBox;
      import javafx.stage.Stage;

      public class Main extends Application {

          public static void main(String[] args) {
              launch(Main.class, args);
          }


          @Override
          public void start(Stage stage) throws Exception {
              stage.setScene(new MainScene());
              stage.show();
          }

          class MainScene extends Scene {

              public MainScene() {
                  super(new HBox(), 1024, 600);

                  new Thread(new Runnable() {
                      public void run() {
                          for (int i = 0; i < 2000; i++) {
                              try {
                                  Thread.sleep(100);
                              } catch (InterruptedException ex) {
                              }
                              Platform.runLater(new Runnable() {
                                  public void run() {
                                      prepareScene();
                                  }
                              });
                          }
                      }
                  }).start();
              }

              private void prepareScene() {
                  HBox root = (HBox) getRoot();
                  root.getChildren().clear();
                  root.getChildren().add(new TextField());
              }
          }
      }

      Attachments

        1. jconsole.png
          jconsole.png
          88 kB
        2. screenshot-1.jpg
          screenshot-1.jpg
          42 kB
        3. TextFielLeak.png
          TextFielLeak.png
          13 kB

        Issue Links

          Activity

            People

              leifs Leif Samuelsson (Inactive)
              ogb Oleg Barbashov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: