Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Crash during Level Load on the iPad

Discussion in 'iOS and tvOS' started by mchawla, Jun 13, 2011.

  1. mchawla

    mchawla

    Joined:
    Aug 11, 2010
    Posts:
    22
    I am facing a Level2 warning straightaway while its loading the scene and it eventually crashes. Actually i'm getting it during a camera flyover which flies through the whole scene but I still get it even if I remove the cutscene.

    Heres, the internal profiler stats right before it crashed:

    iPhone Unity internal profiler stats:
    cpu-player> min: -50.6 max: 123.6 avg: 36.0
    cpu-ogles-drv> min: 6.7 max: 97.7 avg: 20.6
    cpu-waits-gpu> min: 0.2 max: 0.3 avg: 0.2
    msaa-resolve> min: 0.0 max: 0.0 avg: 0.0
    cpu-present> min: 1.3 max: 192.5 avg: 68.3
    frametime> min: 37.3 max: 245.7 avg: 125.1
    draw-call #> min: 176 max: 370 avg: 251 | batched: 137
    tris #> min: 59737 max: 183685 avg: 105281 | batched: 28503
    verts #> min: 89739 max: 249264 avg: 160183 | batched: 57510
    player-detail> physx: 7.6 animation: 0.1 culling 0.0 skinning: 0.0 batching: 0.7 render: 19.3 fixed-update-count: 1 .. 4
    mono-scripts> update: 4.1 fixedUpdate: 1.4 coroutines: 0.0
    mono-memory> used heap: 1060864 allocated heap: 1200128 max number of collections: 0 collection total duration: 0.0
    ----------------------------------------


    Can, anybody have a look at this and help on figuring out whats going on..
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    The profiler will not tell you anything on crashes.

    you must use the xcode debugger on a debug build you send to the device and see what the call stack says, though normally it will say something like "out of memory warning" or you will get a null reference exception or its "native counterpart" the bad acc exception
     
  3. mchawla

    mchawla

    Joined:
    Aug 11, 2010
    Posts:
    22
    Well its definitely running out of memory since I'm getting the Level2 warnings. And there is no callstack in the debugger when i try to backtrace in the gdb. Theres no Null reference or Bad Access exceptions in the scene, I double checked that. Its definitely a memory issue that its running out of RAM on the level load. I'll try and run instruments in Xcode and see what exactly causes this.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    if you get memory warnings its no crash, your app gets killed by iOS for not respecting memory warnings.
    iOS does not send them to be nice, they are real warnings. ignore them twice and the third will be a kill of the whole app.

    you will need to get down the amount of textures you have or use stronger compression likely. you have about 100mb of RAM + VRAM together on ipad if you want to be on the save side with textures that are marked for get pixel being on both (so 2x the ram) and textures loaded through the load commands taking 3-5 times the memory.

    also uncompressed audio or "compress on load" audio is up to 10mb ram per minute of audio, so don't do this for more than a few second audio clips and ensure to kill them once not needed anymore