New MetricKit API
MXBackgroundExitData
- gives counts of each termination type
- includes user killing via app switcher
New MXCrashDiagnostic
- stack trace
- signal
- exception
- termination reason
- timeout during transitions
- disabled in simulator and in debugger
- produces MXCrashDiagnostic
MXCPUExceptionDiagnostic
- call stack can help find "hotspots"
< 200mb for iPhone 6s
- Most common reason for being killed
- System freeing up memory
- Aim for < 50mb in BG
- clear cache
- clear images
- flush state
These don't reproduce in the debugger
Count exposed via MXBackgroundExitData
No crash logs
Preventable!
- keeping bg task < 30 seconds
- use named variant of bgTask to help ID problematic tasks
- use expiration handler on all tasks
Debug using telemetry on start/end of expiration handlers
In MXMetricsPayload
look at signpostMetrics
property
You can leverage backgroundTimeRemaining