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

前端 未结 11 1630
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:24

    I was using Tesseract for OCR and when my target text got scanned, a GIF was supposed to play. When the GIF started to play, there was a memory spike, from 70-80MB to 450MB. The problem was that GIF was taking too much memory, the app would crash and Xcode would show that message. So I removed the concerned imageView from the superview of the ViewController.

    imageView.removeFromSuperview
    

    After this, the app would still spike to 450MB but then immediately release and come down to 40MB

提交回复
热议问题