JavaFX high memory usage

919 Views Asked by At

I'm currently using JavaFX for a 3D-Application (a simple game). I'm displaying a map consisting of blocks where the player can run on. The problem is, when I return to the main menu, the memory allocation is as much as in the game itself (~500MB). So, it seems that Java does not delete the unused references. When I restart the game from the main menu, it goes up to 1GB and so on. I thought the Garbage Collector would take care of those unused references? I thought that it might be the fact that some objects are referencing each other (through Observer/Observable) so I deleted all observers of all the objects, and I set all the objects to "null". Same result. What am I doing wrong?

0

There are 0 best solutions below