You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When presenting a new scene it appears not all memory is freed.
The Demo project shows this, when repeatedly pressing "next" cycling through the maps, memory usage goes up, and never down. On the iOS Simulator I see ± 1MB increased memory used each time, on macOS I see ±5MB of increased memory use each time. The memory graph never goes down.
When trying my own app, with a single TMX file (eg. the famous level1.tmx file from this example) I get 100 MB (!) of increased memory use on macOS and 2 MB on iOS Simulator every time a new SKTiledScene is presented with that map.
When trying with an empty TMX map of size 10x10 tiles with no content, I get 120 MB of increased memory use on macOS and 0.2 MB on iOS Simulator every time a new SKTiledScene is presented.
It appears to me that on macOS the problem is huge, on iOS it is doable
The SKTiledScene.deinit gets called each time so the scene is cleaned up correctly (I think?)
When debugging with Xcodes memory graph it shows no problems or leaks. However, if I don't load a map with SKTiledScene.setup(....) the issue does not occur.
When I override deinit in all classes and print a debug text, I can see that only SKTilemapParser gets deinited immediately after loading the map. All other classes are never deinited.
The text was updated successfully, but these errors were encountered:
ghost
changed the title
Memory leak when presenting new SKTiledScene, small on iOS, larger on macOS
Memory issues when presenting new SKTiledScene, small on iOS, larger on macOS
May 6, 2022
When presenting a new scene it appears not all memory is freed.
The Demo project shows this, when repeatedly pressing "next" cycling through the maps, memory usage goes up, and never down. On the iOS Simulator I see ± 1MB increased memory used each time, on macOS I see ±5MB of increased memory use each time. The memory graph never goes down.
When trying my own app, with a single TMX file (eg. the famous level1.tmx file from this example) I get 100 MB (!) of increased memory use on macOS and 2 MB on iOS Simulator every time a new SKTiledScene is presented with that map.
When trying with an empty TMX map of size 10x10 tiles with no content, I get 120 MB of increased memory use on macOS and 0.2 MB on iOS Simulator every time a new SKTiledScene is presented.
It appears to me that on macOS the problem is huge, on iOS it is doable
The
SKTiledScene.deinit
gets called each time so the scene is cleaned up correctly (I think?)When debugging with Xcodes memory graph it shows no problems or leaks. However, if I don't load a map with
SKTiledScene.setup(....)
the issue does not occur.When I override
deinit
in all classes and print a debug text, I can see that onlySKTilemapParser
getsdeinit
ed immediately after loading the map. All other classes are neverdeinit
ed.The text was updated successfully, but these errors were encountered: