I’m using Debug Mode to monitor performance in my game and noticed that geometries and textures continue to stack up, even after removing entities.
I’ve used world.deleteEntity(eid) to delete entities, which does remove them from the scene, but the geometry count remains unchanged. I also tried explicitly removing geometry-related components like:
But even with those, the geometry count doesn’t decrease.
Additionally, I’m not sure how to remove textures from memory once they’re no longer used. Is there a correct way to fully clean up objects, including both geometries and textures, to avoid memory bloat?
I’m a little bit worried since the geometries and textures stack up throughout the levels, so the performance becomes kind of bad. Sometimes my game even crashes with this error:
Uncaught RuntimeError: Aborted(Cannot enlarge memory arrays to size 75161600 bytes (OOM). Either (1) compile with -sINITIAL_MEMORY=X with X higher than the current value 67108864, (2) compile with -sALLOW_MEMORY_GROWTH which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -sABORTING_MALLOC=0)
Hello George! Do you know if there are any updates on this?
This is the best resource I’ve found so far, but I’m not sure if this causes issues on Studio: