Product Benefits Pricing Guides Docs About Contact us Try it out
Performance

Sentry Cocoa MetricKit Memory Exception Tracking

Sentry Cocoa MetricKit memory exception tracking: capture iOS 27 memory diagnostics and choose which reports to send with SDK 9.32.0.

· 3 min read

Memory kills are the crashes that leave no crash report. iOS ends your app when it uses too much memory, and from your side the session simply stops. Without a signal for this, a rise in memory exits looks like users drifting away, and the real cause sits unnoticed for weeks.

Sentry Cocoa 9.32.0 adds help here. On iOS 27 and later it can capture MetricKit memory exception diagnostics. It also adds options.experimental.metrickit.enabledDiagnosticReports, so you choose which MetricKit diagnostic reports are sent, and enabledMetricReports, which sends MetricKit metric payloads as Sentry metrics. The options are experimental, so treat them as a trial before you rely on them.

Data Points to Track

  • diagnostic_report_type (memory exception, hang, CPU exception, disk write, launch)
  • memory_exception_count per release and per day
  • peak_memory_mb and the memory limit reported with the diagnostic
  • os_version, so iOS 27 devices are separated from older ones
  • device_model and device_memory_gb
  • foreground_state (foreground, background, extension) when the exception happened
  • screen_name or last known route before the exit
  • app_version and sdk_version
  • enabled_report_types as a release property, so you know what was switched on

Setup Steps

  1. Upgrade Sentry Cocoa to 9.32.0 or later.
  2. Choose reports. Set enabledDiagnosticReports to the diagnostics you will act on. Fewer types means less noise.
  3. Decide on metrics. Turn on enabledMetricReports only if you want MetricKit numbers in Sentry metrics.
  4. Tag the build with the enabled report types so you can compare releases fairly.
  5. Test on iOS 27 hardware or a beta device. Memory exception diagnostics need iOS 27 and later, so older devices will not send them.
  6. Build a dashboard of memory exceptions per 1,000 sessions, split by device memory.
  7. Alert when the rate rises above your last stable release.

Actionable Insights

Start with the ratio of memory exceptions to sessions. A flat count can hide growth if your user base is growing, so always use a rate. Then split by device memory. If only low-memory phones are affected, your app probably holds too much in memory at once, for example full-size images or large cached lists.

Next, look at the foreground state. Exceptions in the background point to work that continues after the user leaves, such as sync jobs. Exceptions in the foreground point to a screen that loads too much.

Compare each release with the last. A new feature that raises peak memory is easy to find when you have the release tag and the screen name side by side. Remember that MetricKit data arrives in batches, usually the day after the event, so judge a release after a full day or two rather than after an hour.

Finally, keep an eye on volume. Enabling every diagnostic type can create a lot of events. Start narrow, confirm the signal is useful, then widen.