title: Memory problems when switching between scenes SpriteKit
body: <p>Ok so awhile back in testing I had a random crash with no error, and I have no clue why.  So i went into analyze things and I came up with the following data.
  <a href="https://i.stack.imgur.com/Uhqw1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Uhqw1.png" alt="Data"></a></p>
  
  <p>As it would appear my memory usage is getting higher and higher and higher until it sorta plateus. Notice how at the beginning the slope of the general curvature is greater then later on.  (as you might notice this is my first time going in and analyzing this sort of thing).</p>
  
  <p>Now what happens in the game is that basically their are two screens.
  1.  Menu: this screen has quite a few textures but does nothing except has button to play game
  2. Game: this has TOOONS of textures and has the bulk of the cpu usage because its the actual game.
  3. Death: This screen has one asset, and it is a button that allows you to replay the game.  This should not be using much memory OR cpu.  However it still has memory.  To me this screams whatever a "memory leak" is, is going on.</p>
  
  <p>If you will look at the chart basically what was going on in the game was the menu started, and the first spike was loading up the actual game, then I died.  Then from then on I was switching between the Game and Death screens, each spike signals the Game scene being loaded.</p>
  
  <p>If this data were the way I would predict it you would se an oscillation between a very small memory use for the death screen, and then a return to a game memory usage.</p>
  
  <p>Moral of the story is I am pretty sure that sprite kit isn't properly cleaning up after switching scenes and I need to know why if possible.</p>
  
  <p>Btw in order to switch scenes I am using the method made by maxkargin detailed
  <a href="https://stackoverflow.com/questions/32003930/how-to-create-another-screen-on-my-app/32008866#32008866">here</a></p>
  
  <p>BTW I am working in swift with sprite kit and SKScenes, and SKSpriteNodes</p>
  
  <p>Thanks much!</p>