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

Animated GIFs cause memory leaks in javafx.scene.image.Image class

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 7u13
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:

      Description

      When I use animated gifs in the Image class, the memory won't be released.

      Normal images work fine though.

      See example:


      import javafx.application.Application;
      import javafx.scene.image.Image;
      import javafx.stage.Stage;
       
      public class TestApp2 extends Application {
          public static void main(String[] args) {
              Application.launch();
          }
       
          @Override
          public void start(Stage stage) throws Exception {
       
              for (int i = 0; i < 10000; i++) {
                  new Image(getClass().getResourceAsStream("/animated.gif"));
              }
       
              System.gc();
              System.out.println((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024 + " KB");
          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jandrese Joe Andresen (Inactive)
                Reporter:
                cschudtjfx Christian Schudt (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: