Search Unity

Memory management: what happens on scene change?

Discussion in 'iOS and tvOS' started by TouchSoft, Nov 17, 2008.

  1. TouchSoft

    TouchSoft

    Joined:
    Oct 18, 2008
    Posts:
    218
    I'm more familiar with objective-c and iPhone programing, and not so familiar with javascript (even though it's easy).

    My game seems to slow down after every scene change, and ultimately it crashes after changing scenes 5 - 6 times. At one point it used to crash after the first scene change.

    Once I removed occlusions and view areas... it stopped crashing after first change and now crashes after a few changes.

    Is there some memory management I need to do before scene changes?
     
  2. TouchSoft

    TouchSoft

    Joined:
    Oct 18, 2008
    Posts:
    218
    Also, I just used Mac OSX's Instruments to test performance and it seems after every scene change the app increases the "real memory" by 5mb.

    So when I start my game it's taking 19mb right away.. after a few scene changes it's up to 50mb ... then crashes at around 60mb.

    Are my scenes not being destroyed from the memory?
     
  3. imparare

    imparare

    Joined:
    Jun 24, 2008
    Posts:
    369
  4. TouchSoft

    TouchSoft

    Joined:
    Oct 18, 2008
    Posts:
    218
    whew, Thanks! Good to know I wasn't going crazy.. or doing something completely wrong.