Reference

Background Execution Limits

Background execution limits are Android restrictions that stop apps from running freely once they leave the foreground. The system curbs background services, throttles work via Doze and App Standby, and can place idle apps in restricted buckets, pausing long-running tasks.

Build & packagingAndroid

Background Execution Limits

Also known as: android background limits, background service limits, android background execution limits

Background execution limits are Android restrictions that stop apps from running freely once they leave the foreground. The system curbs background services, throttles work via Doze and App Standby, and can place idle apps in restricted buckets, pausing long-running tasks.

  • Android 8.0+ blocks apps from freely running background services.
  • Doze and App Standby Buckets throttle background CPU, network, and job frequency.
  • Long tasks should use a foreground service or WorkManager, which still respect these limits.

What the limits restrict

Starting with Android 8.0 (Oreo), apps in the background can no longer freely start or keep ordinary background services. The system also applies Doze mode when the device is idle and App Standby Buckets that ration how often an app may run based on how recently the user engaged with it. Newer versions add app hibernation and cached-app freezing, which suspend apps the user hasn't opened in a while.

The intent is battery and performance: an app that drifts into the background loses CPU time, network access, and the ability to run indefinitely. Work that isn't tied to a visible task gets deferred, batched, or killed.

Running long work the supported way

For work that must complete, Android provides sanctioned paths. A foreground service with a persistent notification keeps a task alive while the user is aware of it; on Android 14+ a foreground service must declare a specific type (such as `dataSync`). For deferrable, guaranteed work, WorkManager schedules jobs that respect Doze and standby and resume after interruptions.

Even these are constrained: foreground-service start restrictions, exact-alarm limits, and battery-optimization settings can still defer execution. An app that ignores the rules simply gets its background process reclaimed.

Why a cleanup scan can pause

Scanning thousands of photos for duplicates or computing perceptual hashes is exactly the kind of long-running work the system throttles once the app is backgrounded. If you switch away mid-scan, Android may freeze or stop the process, so the scan appears to stall and resumes when you reopen the app. Cleanor handles this by doing heavy scanning while it is in the foreground and checkpointing progress, so leaving and returning continues rather than restarts — the expected behavior under these limits, not a bug.

Related terms

Keep reading the reference.

Act on it

Guides and tools for this topic.