Background Termination Investigation

Hello,

We are currently investigating an issue where our app is being terminated by the system while running in the background.

At the moment, the app does not perform any significant background activity, and memory usage remains relatively low (approximately 150–200 MB). Despite this, the app is still being terminated in the background, even under conditions where other apps appear to remain active.

From our investigation so far, the issue does not appear to be related to:

  • High memory consumption
  • Explicit background task misuse
  • Application crashes on our side

For additional context, we had previously used silent push notifications to trigger heavy upload operations in the background. Since we suspected this behavior might be contributing to the issue, we completely stopped using this mechanism approximately two weeks ago. However, the background terminations are still occurring.

We would like to better understand the possible causes of this behavior. Specifically, could this be related to:

  • Watchdog terminations
  • Background assertion or lifecycle violations
  • RunningBoard resource management
  • Jetsam policies
  • Background execution timeouts
  • Any other system-level resource or process management constraints

We would greatly appreciate any guidance on how to identify the root cause or which logs/diagnostics we should focus on to further investigate the issue.

Thank you.

Thanks for the post, this is a great reminder about background apps do not run forever and the system will actually terminate them. Investigating background terminations can be notoriously tricky.

Even though your app's memory footprint (150–200 MB) seems reasonable for a foreground app. When iOS needs memory for the active foreground app , it terminates suspended apps starting with those consuming the most memory.

So 150–200 MB makes your app a prime target for Jetsam when it is in the suspended state. Jetsam does not care if your app has a memory leak; it only cares about freeing up RAM for the foreground app. If your app requests a background task to finish up some work when entering the background, but fails to call endBackgroundTask: before the system time quota expires, RunningBoard will terminate the app.

To stop guessing and see exactly why the system is killing your app you should looks at the logs and implement the MetricKit there will have also a reason: https://developer.apple.com/documentation/metrickit/mxappexitmetric

You mentioned stopping heavy uploads triggered by silent pushes. How do you manage those?

Another tools I use is Instruments. Run your app through Instruments using the System Trace. Monitor what happens exactly when you background the app. Are there stray threads still spinning? Is the main thread blocked waiting on a synchronous network call or disk write during applicationDidEnterBackground?

Albert
  Worldwide Developer Relations.

Background Termination Investigation
 
 
Q