B4J Question ImageView x OutOfMemoryError

cmartins

Member
Licensed User
Longtime User
Hi Guys,


I have some issue with imageview, i Put it listview, and the program refresh every 15 seconds reloading all message again.

After some 10 minutes the program crash.

please see the error below

B4X:
java.lang.OutOfMemoryError: Java heap space
    at com.sun.javafx.iio.jpeg.JPEGImageLoader.load(JPEGImageLoader.java:226)
    at com.sun.javafx.iio.ImageStorage.loadAll(ImageStorage.java:309)
    at com.sun.javafx.iio.ImageStorage.loadAll(ImageStorage.java:286)
    at com.sun.javafx.tk.quantum.PrismImageLoader2.loadAll(PrismImageLoader2.java:93)
    at com.sun.javafx.tk.quantum.PrismImageLoader2.<init>(PrismImageLoader2.java:37)
    at com.sun.javafx.tk.quantum.QuantumToolkit.loadImage(QuantumToolkit.java:620)
    at javafx.scene.image.Image.loadImage(Image.java:938)
    at javafx.scene.image.Image.initialize(Image.java:725)
    at javafx.scene.image.Image.<init>(Image.java:539)
    at com.sun.javafx.scene.layout.region.BackgroundImageConverter.convert(BackgroundImageConverter.java:83)
    at com.sun.javafx.scene.layout.region.BackgroundImageConverter.convert(BackgroundImageConverter.java:37)
    at com.sun.javafx.css.StyleHelper.lookup(StyleHelper.java:1090)
    at com.sun.javafx.css.StyleHelper.transitionToState(StyleHelper.java:863)
    at javafx.scene.Node.impl_processCSS(Node.java:7419)
    at javafx.scene.Parent.impl_processCSS(Parent.java:1146)
    at javafx.scene.Parent.impl_processCSS(Parent.java:1153)
    at javafx.scene.Parent.impl_processCSS(Parent.java:1153)
    at javafx.scene.Parent.impl_processCSS(Parent.java:1153)
    at javafx.scene.control.Control.impl_processCSS(Control.java:1154)
    at javafx.scene.Node.processCSS(Node.java:7387)
    at javafx.scene.Node.processCSS(Node.java:7381)
    at javafx.scene.Node.processCSS(Node.java:7381)
    at javafx.scene.Node.processCSS(Node.java:7381)
    at javafx.scene.Node.processCSS(Node.java:7381)
    at javafx.scene.Node.processCSS(Node.java:7381)
    at javafx.scene.Node.processCSS(Node.java:7381)
    at javafx.scene.Node.processCSS(Node.java:7381)
    at javafx.scene.Node.processCSS(Node.java:7381)
    at javafx.scene.Scene.doCSSPass(Scene.java:454)
    at javafx.scene.Scene.access$3800(Scene.java:173)
    at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2204)
    at com.sun.javafx.tk.Toolkit$5.run(Toolkit.java:363)
 

jmon

Well-Known Member
Licensed User
Longtime User
You could use loadImageSample.

The weird thing is that in your code I don't understand why you reload the image all the time. It doesn't change, so why reloading it?
 
Upvote 0

cmartins

Member
Licensed User
Longtime User
I have removed the load image and decrease the timer to 3500 3.5 seconds to refresh the list and the issue persist. the app crash about 6:40". any idea?
 
Upvote 0
Top