I’ve built a 2D-gameengine for classical games such as SuperMario or similar where you can define several “levels” as different GameSlides where each gameslide has neighbouring gameslides and so on.
The same concept as when playing Diablo I / II and you walk out from the village and you have to “load the next level”.
Which brings me to the question:
This loading between gameslides works well enough for smaller games, but I just made my own Zelda-style game with quite big background images and suddenly I get a OutOFMemoryException (due to the big background I suppose) Therefor I have to deallocate the allready loaded stuff when I change slide and THAT’s the question…
I chech the available memory using Runtime freeMemory() / availableMEmory() / totalMemory() and nomatter what I try, it just won’t deallocate and free the previous slides…
How do I manually remove stuff from the heap?
(much text for a trivial question, but I hope you get my point)
/Markus