-
Bug
-
Resolution: Not an Issue
-
P4
-
fx2.1
-
Windows
I've seen a memory leak that I confirmed also under JavaFX 2.1.0-beta-b19 on top of Java 1.6. Basically I have a JavaFX application in which I display through an ImageView object a different JPEG image every 30 seconds. The relevant code looks like,
inputStream = ClassLoader.getSystemResourceAsStream(...
imageView.setImage(new Image(inputStream));
...
inputStream.close();
Unfortunately, when running the application with the NetBeans memory profiler it shows that the image bytes are never garbage collected resulting in a significant memory leak. Every time an image is loaded NetBeans reports that the number of allocated objects of the class 'sun.net.www.protocol.file.FileURLConnection' increases by one, also the image data continuously increase in memory throughout the application execution time as byte[] data.
I have also attached a quick test application (ImageTest.java) that reproduces the described memory leak.
inputStream = ClassLoader.getSystemResourceAsStream(...
imageView.setImage(new Image(inputStream));
...
inputStream.close();
Unfortunately, when running the application with the NetBeans memory profiler it shows that the image bytes are never garbage collected resulting in a significant memory leak. Every time an image is loaded NetBeans reports that the number of allocated objects of the class 'sun.net.www.protocol.file.FileURLConnection' increases by one, also the image data continuously increase in memory throughout the application execution time as byte[] data.
I have also attached a quick test application (ImageTest.java) that reproduces the described memory leak.