I had written a software by using javaFx but I noticed memory leak in JVM
so after 5 minutes it will stop with an OutOfMemoryError
.
I search alot but I did not find solution. I will share code about openinig new page in same stage and scene
DashboardController.centerStatic.getChildren().clear();
FXMLLoader fl =new FXMLLoader("page.fxml",Lang.getResourceBundle());
//static centerStatic
DashboardController.centerStatic.getChildren().setAll((AnchorPane)fl.load());
when I call the new page it will execute queries and adding listeners and eventhandlers so it will fill memory with 50 mb
but after call new page it is not free the memory
so I get memory leak after 5 minutes
please help us thanks