Megamozg
Megamozg

Reputation: 1063

Does Crashlytics generates crash report on low memory app termination(iOS)?

Does Crashlytics generates crash report when system terminates iOS application on low memory condition and application is in:

  1. Background
  2. Foreground

Upvotes: 0

Views: 1288

Answers (2)

mfaani
mfaani

Reputation: 36447

Yes. Crashlytics >> OOM crashes. You can see your stats for different builds.

enter image description here

It's usually unlikely that the app will kill you in the foreground. It's actually quite unusual for an app to kill a foregrounded app due to memory issues. Most of the time that happens when your app is in the background. Because other apps need to consume memory to work.

For a device with 2Gb of RAM, it's best that your app has a memory footprint of max 1Gb* in foreground and 100Mb in background. I know for instance if you open a new tab in Safari then that will take about ~100Mb from your memory. And if you go an open 3-4 more apps then your app will become less prioritized and more likely to be killed off the memory. And if it has to choose between two apps which haven't been used lately then likely it will choose an app that has a bigger memory footprint.


*: If your app is using 1Gb of memory then your app is adding pressure to other apps. Not directly your problem but still something to be considerate of. You don't want to be a bad app for the OS. Hence 300Mb is more reasonable.

Upvotes: 1

dandan78
dandan78

Reputation: 13925

Based on the information I was able to find, the answer is yes, it does but only if the app was running in the foreground when the termination took place.

However, it also seems there is no sure-fire way to detect this kind of crash. Crashlytics and other crash reporting framework analyze crash data after the fact, which is to say the next time the app is run. In this case, they try to eliminate other potential termination reasons first and if nothing else matches, then it's probably an out-of-memory termination.

Upvotes: 3

Related Questions