r/iOSProgramming • u/murki • Sep 25 '26
Article You can use MetricKit to detect OOM terminations on iOS 27. This is how we used it to improve crash detection
https://blog.bitdrift.io/post/oom-reporting-ios
26
Upvotes
6
u/HeyWangKang Sep 26 '26
The stack trace is a useful starting point, but I'd be careful about treating the top frame as the cause of an OOM. A concrete triage step would be to line up the memory chart with screen transitions and expensive work like image decoding or cache fills, then compare a few affected sessions on the same device class. If memory climbs across repeated visits to one screen, that's a much better lead than the final allocation that happened to cross the limit.
3
u/Golden_Jiggy Sep 27 '26
This is SO nice.
3
u/[deleted] Sep 29 '26
Here's how we did it in the times before MetricKit existed:
As you can see, the normal working app won't have the file on start. If the app crashes for any reason the file also most likely would not exist. What the file indicates is "there was a crash after low memory event" which you can read as a high certainty OOM, especially if the number parameter is > 1.