<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetricKit",
  "identifier" : "/documentation/MetricKit/BackgroundTerminationMetric",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "MetricKit"
    ],
    "preciseIdentifier" : "s:9MetricKit021BackgroundTerminationA0V"
  },
  "title" : "BackgroundTerminationMetric"
}
-->

# BackgroundTerminationMetric

A metric that counts app terminations from the background by category.

```
struct BackgroundTerminationMetric
```

## Discussion

This metric corresponds to the [`MetricResult.backgroundTermination(_:)`](/documentation/MetricKit/MetricResult/backgroundTermination(_:)) case. It appears in both [`intervalEntries`](/documentation/MetricKit/MetricReport/intervalEntries) and [`stateEntries`](/documentation/MetricKit/MetricReport/stateEntries) when state reporting is enabled.

Use [`terminationCategory`](/documentation/MetricKit/CrashDiagnostic/terminationCategory-swift.property) to correlate individual crash diagnostics with these aggregate counts.

Unexpected background terminations can affect downstream performance metrics such as launch time, because the app must fully restart instead of resuming from suspension. For information about launch times when the app resumes from suspension, see [`ApplicationResumeTimeMetric`](/documentation/MetricKit/ApplicationResumeTimeMetric).

## Topics

### Background termination counts

[`let normalTerminationCount: Int`](/documentation/MetricKit/BackgroundTerminationMetric/normalTerminationCount)

The number of times the application terminated normally from the background.

[`let memoryLimitTerminationCount: Int`](/documentation/MetricKit/BackgroundTerminationMetric/memoryLimitTerminationCount)

The number of times the system terminated the app from the background for using too much memory.

[`let highCPUTerminationCount: Int`](/documentation/MetricKit/BackgroundTerminationMetric/highCPUTerminationCount)

The number of times the system terminated the app from the background for using too much CPU time.

[`let systemPressureTerminationCount: Int`](/documentation/MetricKit/BackgroundTerminationMetric/systemPressureTerminationCount)

The number of times the system terminated the app from the background to free up memory.

[`let badAccessTerminationCount: Int`](/documentation/MetricKit/BackgroundTerminationMetric/badAccessTerminationCount)

The number of times the system terminated the app from the background for attempting an invalid memory access.

[`let abnormalTerminationCount: Int`](/documentation/MetricKit/BackgroundTerminationMetric/abnormalTerminationCount)

The number of times the app terminated abnormally from the background.

[`let illegalInstructionTerminationCount: Int`](/documentation/MetricKit/BackgroundTerminationMetric/illegalInstructionTerminationCount)

The number of times the system terminated the app from the background for attempting to execute an illegal or undefined instruction.

[`let watchdogTerminationCount: Int`](/documentation/MetricKit/BackgroundTerminationMetric/watchdogTerminationCount)

The number of times the system watchdog terminated the app from the background.

[`let fileLockTerminationCount: Int`](/documentation/MetricKit/BackgroundTerminationMetric/fileLockTerminationCount)

The number of times the system terminated the app from the background while being suspended and having file locks.

[`let taskTimeoutTerminationCount: Int`](/documentation/MetricKit/BackgroundTerminationMetric/taskTimeoutTerminationCount)

The number of times the system terminated the app from the background for exceeding the allocated time for a background task.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

[`Encodable`](/documentation/Swift/Encodable)

[`Decodable`](/documentation/Swift/Decodable)

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)