I built a JavaFX(8) 3D application, which reads data from some file and renders it on some scene.
For rendering an object, I use:
graphicsContainer.getChildren().add(some3dObject);
When I comment out this line, for disabling the rendering, I have no memory leaks at all.
But when this line does run, the application consumes more and more memory. I have 30 frames per second and every second the memory consumption raises in ~50MB.
This is of course, although between the frames I use:
graphicsContainer.getChildren().clear();
The 3D objects I assign to the graphicsContainer
are local are not saved in any static/global scope. They are only saved as children of the graphicsContainer
, which is cleaned on every frame.
It seems that something in the JavaFX-3D engine does not really clear my work although I remove each time the children of the graphicsContainer
.
Any idea how to make JavaFX 3D engine release the past 3D objects and renderings?