I am working on a JavaFX image slide show application and after some time a java error without free memory error has worked. In the interface code, I have:
image = new ImageView(); Group root = new Group(image); imageScene = new Scene(root, height, width); primaryStage.setScene(imageScene);
In the background thread, I set the image source to view the image:
... Map<String, Image> imagesMap = new HashMap<>(); ... // Slide thread if (!imagesMap.containsKey(item.File)) { Image image = new Image(item.File); imagesMap.put(item.File, image); } Image i = imagesMap.get(item.File); image.setImage(i);
Although running the application (with parameters: -XX: + UnlockExperimentalVMOptions -XX: + UseG1GC -Xmx256m), the memory allocated for the Java process always increases ...
source share