Is it possible to debug “Terminated due to memory error”?

前端 未结 11 1615
Happy的楠姐
Happy的楠姐 2020-11-29 05:57

In a certain (consistent) point when my app is running, I consistently get the xcode error message

Terminated due to memory error.

相关标签:
11条回答
  • 2020-11-29 06:01

    I had similar issue in Xcode 11.3 wherein camera was getting calling every-time we press on try again button. If these is done multiple times then crash happens.

    This was fixed when we disabled Zombie objects. Below are steps:

    1. Tap on project name present in top left. This will show list of targets present in project.
    2. Tap on Edit scheme

    1. Select Run option -> Diagnostics -> Uncheck Zombie Objects.

    Now, run your project. It should work fine.

    0 讨论(0)
  • 2020-11-29 06:07

    I was getting this error and could not understand what was wrong.

    After some searching I found out that i forgot to disable zombies.

    To disable do the following:

    Select edit scheme

    Deselect "Enable Zombie Objects

    0 讨论(0)
  • 2020-11-29 06:09

    With Xcode 11 it started my project in Debug mode. I am doing some image recording/editing/returning to the user and that is not something you can use in Debug. Once I turned to Release mode, all went well.

    0 讨论(0)
  • 2020-11-29 06:14

    The thing that I noticed is that when I run my app on the device through cable and leave it idle for a long time I will also get that error.

    Apple do address this and it just might be that it feels like the app is idle and just kills it.

    0 讨论(0)
  • 2020-11-29 06:14

    I got this error because I was adding full size photos to a collectionView cell sized 40x40. Read the 2 comments under the question from @matt. I had to scale down the images before adding them to the cell.

    0 讨论(0)
  • 2020-11-29 06:15

    I was faced the same issue.("Terminated due to Memory Error") I had tried the above all answers but nothing work for me. Then i debug my code and found a for loop is running for infinity time with allocating memory to a array with nil value every time.its use 300+MB so it give this error

    Thanks.

    0 讨论(0)
提交回复
热议问题