I'm building a metroidvania using Tiled and Rexrainbow's TMXImporter. The tiles are frames in a sprite object.
When a room is loaded the tiles are created, then 4 canvas objects and 4 empty sprite objects are created and stretched out to the size of the room. I then paste all the tiles into the canvases, then load the canvas images into the sprite objects (because WebGL and canvas don't go well together) and finally destroy all the tiles and canvases. Bada bing bada boom - hundreds of tiles are now 4 medium-sized sprite objects and performance is great. When all is said and done, the previous room is destroyed in its entirety.
I started keeping track of RAM & VRAM and every time I load a new room these numbers go up - even if the room uses the exact same tiles and objects as the last.
What can I do about this? If you play the game for too long you'll surely run out of memory, and I'm not seeing "dump textures from memory" or anything like CC had so I'm starting to freak out a bit. Thanks for any help!