0

I'm making a simple game using Xcode 10.1 IDE and swift 4.2

I've designed the main menu system so that each pages UI is presented through a separate scene.

Each time a new scene is loaded I get approximately 0.1 MB increase in memory usage. Not much but I don't want to start scaling the game with this issue.

Memory leak when presenting SpriteKit scenes

Memory problems when switching between scenes SpriteKit

Tab-based SpriteKit Apps and Scene Caching

I've had a good look through reference material and online. I've checked for Retain Cycles, through the following: Inserted deinit statements at the end of all scenes and object classes used. They are all called correctly. Profiled the app to look looking for zombie objects and leaks, with nothing obvious shown in the profiler results when running.

Does anyone have any idea to what causes memory leaks or caching on scene transitions and ways to prevent this?

I'm stumped scaling the game now seems like the wrong thing to do as the issue will probably compound as complexity increases.

hoboBob
  • 832
  • 1
  • 17
  • 37
  • Without any code it's difficult to figure out what might be the issue. Because 0.1 MB is so small, I wouldn't worry about it right now and just work on getting your game running and deal with the minor details later. – KissTheCoder Dec 11 '18 at 16:49

1 Answers1

0

After further testing I found the issue is with attaching sound actions through scene editor.

Attaching the actions through code gives stable memory use, with no increase of 0.1MB through scene transition.

Its only a partial answer but if any one else comes across this and has further info please post

hoboBob
  • 832
  • 1
  • 17
  • 37