Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recognise an out of memory crash (IOS)

Tags:

ios

iphone

Our apps are live on the app store. I wish to recognise crashes of out of memory that some users are getting. I understand there is no way to 100% recognise an out of memory crash. Is there any way to recognise these crashes(with a pretty large probability) by doing some logic in the applicationDidReceiveMemoryWarning? (I am not talking about finding it in xcode during development time, i am talking about code that will recognise the out of memory crash from actual users and will log something to file)

like image 634
AJ222 Avatar asked Jun 09 '13 11:06

AJ222


People also ask

How do I view iOS crash logs?

You can use the Mac Console app to view any crash logs from your Mac or from the Simulator. And on the device under Settings, Privacy, Analytics, Analytics Data you can see all of the logs that are saved to disk and your users can share a log directly from this screen.

What are the most causes of out of memory error crash in apps?

Memory leaks are one of the main culprits that can cause an OOM, especially retain cycles. Retain cycles occur when two or more objects hold a strong reference to each other causing them to remain held in memory indefinitely.

What causes apps to crash on iOS?

Most often, apps crash because they aren't updated and have unaddressed bugs. To fix this, go to the Updates section of the App Store and update the app if an update is available.


1 Answers

While I was looking for any service or library that give me OOM tracking, I could only find this article from Facebook engineering:

https://code.facebook.com/posts/1146930688654547/reducing-fooms-in-the-facebook-ios-app/

The idea is to deduce the reason why the app needs to be launch, checking different aspects (like if the app was at background, if there is an app/OS update,...).

Discarding all the other possible reason that can force the previous app exit, you can know if the reason is a background out of memory or a foreground out of memory.

It would be nice to have a library that implements the Facebook article procedure. But nowadays I couldn't find any, probably there is some reason that make this difficult or may be impossible to add it as an sdk.

If anyone knows any service, please share it with everyone with a comment or a new answer.

Edit:

I have discovered this github (https://github.com/jflinter/JRFMemoryNoodler) with an implementation of the Facebook post procedure. I haven't tried yet, but we will deploy it in our apps to try it.

like image 149
Néstor Avatar answered Oct 19 '22 14:10

Néstor