Search Unity

EXC_RESOURCE crash when running game on IOS

Discussion in 'iOS and tvOS' started by EarthHobbit, Aug 2, 2019.

  1. EarthHobbit

    EarthHobbit

    Joined:
    May 10, 2016
    Posts:
    46
    I have a game I developed on Unity and since roughly a week (upgrade from Unity 2019.1 to 2019.2 ?), running my game on IOS crashes after few seconds with
    EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=1800 MB, unused=0x0)

    I profiled my app, optimised textures but keep getting the issue. I am not really able to find where the issue could come from. Could someone let me know if memory values from Profiler below seem abnormal.
    Thanks !

    Screenshot 2019-08-02 at 16.23.33.png Screenshot 2019-08-02 at 16.23.45.png
    Screenshot 2019-08-02 at 16.31.39.png Screenshot 2019-08-02 at 16.31.54.png
     
  2. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    516
    1GB of GPU memory used is very odd, especially you have 518 render textures that uses more than half a gig. Where are you using that many render textures? Did you release them properly? (https://docs.unity3d.com/ScriptReference/RenderTexture.Release.html) Also, have you tried using memoryless RenderTexture?

    As a background knowledge, GPU memory and CPU memory in iOS devices are shared, i.e. they are using same chunk of physical memory, so the resource limit counts both usages.
     
    Last edited: Aug 3, 2019
  3. EarthHobbit

    EarthHobbit

    Joined:
    May 10, 2016
    Posts:
    46
    Thanks for your answer. I found out I was duplicating a lot of meshes and textures and cleaned them up. However the app is still crashing. Looking at the Simple memory analysis shows 1383 textures for 1.09 GB (I am sure I don't have that many textures), but looking at the Detailed analysis, it shows me 211 textures for 227MB. Where could the difference come from ?
    As my app is crashing at scene loading now, I can't even play with textures. How can I dig in more into the real issue ?
    Thanks a lot ! Screenshot 2019-08-09 at 14.56.13.png Screenshot 2019-08-09 at 14.56.41.png