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

memory leak when recreating ImageView with a GIV image

    XMLWordPrintable

    Details

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

      Description

      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.)



        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported: