How does one debug this Xcode error on an iOS device?

Debug - UnityGfxDeviceWorker (34): EXC_RESOURCE RESOURCE_TYPE_MEMORY

  • \$\begingroup\$ There seems to be lots of discussion of this out-of-memory error elsewhere on the net. What troubleshooting steps have you taken based on your research so far? \$\endgroup\$
    – DMGregory
    Apr 30, 2021 at 21:12
  • 1
    \$\begingroup\$ It sounds like you ran out of memory. Use the profiler in the Unity Editor to see how much memory your application uses. You might have a memory leak, or your assets might be too large (e.g. textures too high-resolution). \$\endgroup\$
    – Kevin
    Apr 30, 2021 at 22:39
  • \$\begingroup\$ i'm not seeing the leak in the editor. it happens on device though \$\endgroup\$
    – ina
    May 1, 2021 at 0:37

1 Answer 1


Along with a plethora of other reasons, your computer has more memory at it's disposal compared to your phone/tablet so you're unlikely to experience "out of memory" errors. Because this error is happening an iOS device you'll want to use Xcode to further debug your situation. Specifically it sounds like you are dealing with a memory leak, which in your case is likely creating more game objects than you are removing (GameObject.Destroy(myObject)

Just like unity has profiling tools for itself, Xcode has profiling tools (instruments) for mac & iOS devices. I'm attaching a links for 1) how to find memory leaks using the Unity profiler and 2) how to find memory leaks using xcode

  1. https://unity.com/how-to/use-memory-profiling-unity
  2. https://developer.apple.com/library/archive/documentation/Performance/Conceptual/ManagingMemory/Articles/FindingLeaks.html

Keep in mind that a there is a lot of content & video covering memory leaks so if the links I posted seem tricky to follow you may have better luck searching the web & youtube.



You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .