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

memory leak when recreating ImageView with a GIV image

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7u6
    • javafx

      An ImageView can contain an Image which uses a gif image. When the user clicks on a button, the application has to do some work and we switch the normal png image with a moving gif image.

      Everytime we switch, we create the ImageView and the Image. This causes a memory leak.In visualVM, I see a lot of int[] which are not GC.

      When I do not create the ImageView (and Image) but keep them as private attributes, there is no memory leak.

      See attachment for project! It contains 1 class with 1 main method. It also contains 1 png and 1 gif. When the code on line 48 and 49 is uncommented, and the lines 56,57 commented, the memory bug is gone.

      (So we have a very good workaround and now we always reuse ImageViews in application.)



            kcr Kevin Rushforth
            pnelissenjfx Peter Nelissen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: