1

I am building an app, which takes pictures from the camera and uses AVAssetWriter to create a video file. Though the app is working perfectly on iPhoneX, but it crashes on my iPhone 6.

The peak memory usage while recording this video is around 250MB, yet the app is crashing and the console says, Terminated due to memory issue.

The peak memory usage is same on both iPhone 6 and X.

Every time the app crosses 230MB, applicationDidReceiveMemoryWarning is fired. Why is the app crashing at such low memory usage?

A similar question is already there: high peak memory usage when writing large amount images to video file using AVAssetWriter but with no solution.

Mitul Jindal
  • 620
  • 4
  • 16
  • paste your code with question – MAhipal Singh Jul 11 '18 at 10:16
  • iPhone X has 3GB of RAM and this is 3x more than the iPhone 6. If your app is consuming 25% of the device's available RAM the system is killing the process due to the high memory usage. – Todor Brachkov Jul 11 '18 at 11:00
  • @TodorBrachkov, I have tested this with other apps, iOS doesn't kill app on the same iPhone 6 till it reaches 650MB. – Mitul Jindal Jul 11 '18 at 11:03
  • It can be because of a sudden hike in the memory graph and considering the percentage of memory used at that point with respect to the total ram and other open apps. – abhimuralidharan Jul 11 '18 at 11:22
  • @abhi1992 In our testing using the code in https://stackoverflow.com/questions/21071311/how-much-memory-can-one-ios-app-use on multiple devices, speed of allocation doesn't matter. Sleeping a second after each 100MB allocation doesn't make a difference. – Kartick Vaddadi Jul 16 '18 at 14:37

0 Answers0