-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
7u6
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.)
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.)
- duplicates
-
JDK-8117172 Memory leak with Animated images
-
- Closed
-