Search Unity

Ram usage drastically different on iOS release than debug

Discussion in 'iOS and tvOS' started by Culzean, Oct 31, 2017.

  1. Culzean

    Culzean

    Joined:
    Jan 25, 2014
    Posts:
    48
    I am building an iOS project to device and have encountered a problem with memory usage. On loading and building the main game scene my app is getting ejected for using way too much ram. The device is a iPad mini 2. It quickly uses up over 500Mb of ram and gets ejected.
    However, if I build the same app as a debug to the same device it easily runs the scene and keeps ram usage under 400Mb.
    Can anyone think what would cause such a drastic difference in ram usage when swapping to release build?
    I have been through many of the normal memory optimizations such as dropping texture quality, removing some unused shaders and checking GC usage with the profiler.
    However I have only been able to run the deep profile in the editor or when running in debug. So I am really only guessing at what is causing the large spike when running release.
     
  2. Culzean

    Culzean

    Joined:
    Jan 25, 2014
    Posts:
    48
    Ok it seems to be a problem running under metal. Here's a comparison for the same level getting loaded under metal and the other under OpenGL ES 3. Both builds are release.
    In the metal build this screen shot is just before the app hits 599Mb and gets ejected.
    Just to be clear the app runs find under OpenGL 3 Release/Debug and runs fine under metal as debug.
    But the memory behaves very differently under metal release builds.
    I am running Unity 2017.1.2p2
     

    Attached Files:

    DanarKayfi likes this.
  3. Culzean

    Culzean

    Joined:
    Jan 25, 2014
    Posts:
    48
    Moving to Unity 2017.2 solved this issue but unfortunately introduced a different issue. One of the plugins the project uses is not working correctly with Unity 2017.2.
    So hopefully this fix is released in a future patch.