You charge your iPhone before going to bed, unplug it or leave it on a wireless stand, and wake up seven hours later to a shocking sight: your battery has dropped by 30%, 40%, or even drained completely to 0%! You touch the back of the phone, and it feels uncomfortably warm. You check Settings > Battery, and the graph shows continuous, solid green background activity throughout the night, attributing the drain to 'Home & Lock Screen', 'Photos', or obscure system services. Why does an iPhone sitting completely idle on Wi-Fi burn through its battery while you sleep? The culprit is almost always low physical storage trapping iOS background daemons in an infinite crash-and-respawn indexing loop. Here is the low-level science and the permanent fix.
1. Nocturnal Maintenance: What Your iPhone Actually Does While You Sleep
Most smartphone owners assume that when the display turns off at night, the iPhone enters a low-power deep sleep state (sleep mode).
In reality, iOS schedules its heaviest, most computationally intensive machine learning tasks to run exclusively when three conditions are met:
- The iPhone is connected to AC power or sitting on a wireless charger.
- The iPhone is connected to a stable Wi-Fi network.
- The user is not actively interacting with the device (detected via sleep schedules and ambient light sensors).
During this nocturnal maintenance window, the Mach kernel wakes up a suite of high-priority system daemons:
photoanalysisd: Uses the Neural Engine to scan your photo library for facial recognition, pet identification, duplicate detection, and visual search objects.mediaanalysisd: Transcodes video thumbnails, evaluates video stability, and indexes audio tracks for Siri voice search.spotlight (mds / mdworker): Rebuilds local search catalogs across messages, emails, and installed app containers.mobileassetd & softwareupdated: Queries Apple's CDN servers to download delta iOS updates and security assets.
Under normal conditions, this indexing completes in 30 to 60 minutes, after which the device enters low-power sleep mode, consuming less than 3% battery overnight.
2. The Crash-and-Respawn Loop: When Low Storage Breaks 'photoanalysisd'
What happens when your iPhone has less than 2GB of available storage during this nocturnal maintenance window?
The background maintenance routine transforms into a hardware-punishing death loop:
launchdlaunchesphotoanalysisdto analyze the day's newly captured photos.- The daemon attempts to allocate temporary scratchpad memory in
/private/var/mobile/Media/PhotoData/Caches/to build facial recognition feature vectors. - The APFS file system returns
ENOSPC(Error 28: No space left on device). photoanalysisdencounters an unhandled out-of-memory exception and crashes violently.- The iOS process supervisor (
launchd) detects that a critical system service died unexpectedly and immediately respawns it 10 seconds later!
This crash-and-respawn cycle repeats thousands of times throughout the night. The high-performance Apple Silicon CPU cores are pinned at 100% utilization for 8 straight hours, causing the phone to run scalding hot and burning through 40% battery or draining faster than a 5W charger can replenish!
3. The Chemical Toll: How Overnight Heat Destroys Battery Health
The tragedy of the low-storage indexing loop is not merely waking up to a drained phone; it is the permanent physical damage inflicted on your battery hardware.
Lithium-ion pouch batteries are sensitive chemical cells. When an iPhone is charging on a nightstand while its CPU is simultaneously pinned at 100% utilization handling daemon crashes, battery cell temperatures routinely exceed 42°C to 45°C for hours at a time.
Sustained exposure to high temperature while at high state-of-charge (80%–100%) triggers rapid degradation of the lithium cathode and electrolyte breakdown. Users caught in this loop frequently watch their Maximum Capacity health drop by 1% every two weeks!
4. The 3-Minute Triage: Stop the Loop with Swipe Photo Cleaner
To break this destructive nocturnal cycle and restore cool, deep overnight sleep to your iPhone, you must eliminate the low-storage condition:
- Launch Swipe Photo Cleaner. Review your camera roll and swipe away 15GB to 25GB of duplicate bursts, accidental long screen captures, and video junk.
- Empty Recently Deleted in the Photos app to immediately return unallocated blocks to the APFS storage controller.
- Install any pending iOS software update in Settings > General > Software Update. Installing the update completely deletes the 8GB staging installer payload upon reboot.
- Once your iPhone has at least 15% free storage headroom,
photoanalysisdwill execute its indexing pass cleanly in under 20 minutes, allowing your iPhone to rest in deep sleep mode and wake up at 100% battery every morning.
5. The Daemon Dependency Graph: How 'launchd' Manages Nocturnal Tasks
To understand why your iPhone burns battery overnight while sitting idle, one must examine the launch daemon dependency graph inside iOS.
All background execution on iOS is orchestrated by launchd (Process ID 1). In modern iOS, Apple uses an activity scheduling framework called Centralized Task Scheduling (CTS) and DuetActivityScheduler (DAS).
Every evening, DAS calculates an operational score based on:
- Whether the device is plugged into AC power (
IOPSPowerSourceSupported). - Whether the battery state is charging or full.
- Whether unmetered Wi-Fi is active.
- Whether screen sleep has persisted for over 15 minutes.
When all flags are green, DAS fires the master nocturnal maintenance trigger: com.apple.dasd.maintenance.nocturnal.
This awakens dozens of sub-daemons: photoanalysisd, mediaanalysisd, knowledge-agent, searchindexer, and backupd.
Crucially, these daemons are designed to run with QoS (Quality of Service) class Utility. But when a daemon encounters an unrecoverable disk write error, it exits with an abnormal status code.
Under POSIX supervisor rules, launchd interprets unexpected crashes as high-priority failures and immediately re-launches the daemon. This elevates the CPU priority class from Utility to User-Interactive, keeping the high-performance CPU cores pinned all night long!
6. Console.app Telemetry: Inside the Nocturnal Crash Storm
Inspecting an iPhone's console logs after an overnight battery drain event reveals the repeating pattern of daemon thrashing:
[error] photoanalysisd: (PhotoAnalysis) [GraphBuilder] Failed to write scene classification tensor: Error Domain=NSPOSIXErrorDomain Code=28 "No space left on device" [fault] photoanalysisd: Unhandled database transaction failure. Forcing process abort. [notice] com.apple.xpc.launchd: Service "com.apple.photoanalysisd" exited due to SIGABRT (Exit code: 6). [notice] com.apple.xpc.launchd: Respawning "com.apple.photoanalysisd" in 10.00 seconds. [error] mediaanalysisd: [StorageWatchdog] Emergency storage threshold breached (Free: 218 MB). Halting video stabilization analysis. [warning] kernel: (AppleARMPE) High thermal dissipation detected during sleep state (Core 0-3 frequency: 3.4 GHz). Throttling charge current.
Notice the final kernel warning: the CPU cores were running at 3.4 GHz while the device was supposed to be sleeping! The phone consumed 30% battery overnight because it was running a continuous, multi-threaded crash loop.
7. The Architecture of Nocturnal iOS Daemons: A Deep Dive
Apple's iOS operating system is renowned for its smooth user experience, largely because heavy background processing is deferred until the user is asleep.
Let us examine the exact resource profile of the four primary nocturnal maintenance daemons:
| Daemon Name | Subsystem | Required Scratchpad Space | Failure Mode on Low Storage |
|---|---|---|---|
| photoanalysisd | Neural Engine / Vision | 2.0 GB – 4.0 GB | Continuous SIGABRT crash loop |
| mediaanalysisd | CoreMedia / AVFoundation | 1.5 GB – 3.0 GB | Video indexing aborts |
| mdworker / mds | Spotlight Search Engine | 1.0 GB – 2.0 GB | Search indexing frozen |
| mobileassetd | Over-the-Air Update Staging | 6.0 GB – 10.0 GB | Partial installer corrupts System Data |
Notice that collectively, these nocturnal daemons require between 10.5GB and 19GB of temporary unencumbered scratchpad space to perform their duties safely.
If your iPhone has only 1.2GB free, every single one of these daemons encounters disk write failures, crashing repeatedly and locking CPU cores at maximum frequencies throughout the night.
8. The 4-Step Overnight Battery Protection Blueprint
To ensure your iPhone stays cool on the charger and wakes up at 100% battery without nocturnal heat stress:
- Maintain a 15% Storage Floor: Treat the final 15% of your storage as reserved for system indexing. If you have a 128GB iPhone, keep at least 19GB free.
- Run Swipe Photo Cleaner Weekly: Use Swipe Photo Cleaner for 2 minutes every week to purge duplicate bursts, accidental pocket recordings, and obsolete screenshots.
- Install Downloaded iOS Software Updates: Never leave an 8GB update sitting uninstalled in Settings. Installing it completely deletes the staging installer upon reboot, freeing up 8GB to 12GB+ of net storage!
- Enable Optimized Battery Charging: In Settings > Battery > Battery Health, ensure 'Optimized Battery Charging' or '80% Limit' is turned ON to protect lithium chemistry from heat damage.
9. The Nocturnal Crash Storm: How 'photoanalysisd' Burns Battery
To understand why an iPhone drains battery while sleeping on Wi-Fi, one must look at how the machine learning Vision framework executes in iOS.
The photoanalysisd daemon uses the 16-core Apple Neural Engine to analyze photos for faces, pets, text (Live Text), and scene semantics.
To analyze a single photo, the daemon must:
- Decompress the image into an uncompressed pixel buffer in RAM.
- Run the machine learning inference graph on the Neural Engine.
- Generate a 512-byte floating-point feature embedding vector.
- Write that vector into
/PhotoData/Photos.sqliteand/PhotoData/Caches/Graph/.
If the iPhone's physical storage is under 2GB, step 4 fails with an unrecoverable ENOSPC error. The daemon encounters a fatal exception and crashes.
Because launchd is programmed to keep system daemons alive, it immediately restarts photoanalysisd 10 seconds later.
This crash-and-restart loop repeats thousands of times across the night. The Apple Silicon efficiency and performance cores are pegged at maximum clock frequencies for 8 straight hours, causing the phone to run scalding hot and burning through 30% to 40% battery while you sleep!
10. How Uninstalled 8GB iOS Updates Trigger Nocturnal Battery Drain
In many cases, the user hadn't changed any settings, but their overnight battery drain suddenly spiked.
The hidden catalyst is an overnight iOS update download. When an 8GB update is downloaded into /private/var/MobileSoftwareUpdate/, it pushes available storage from 9GB down to 1GB.
That sudden drop pushes photoanalysisd into the critical storage crash loop!
The ultimate cure is installing that update! Tapping 'Install Now' applies the patches and permanently deletes the 8GB staging installer upon reboot. Combined with 3 minutes of culling photo clutter via Swipe Photo Cleaner, your phone will have 20GB+ of clean headroom, allowing nocturnal indexing to finish in 20 minutes and letting your phone rest in deep sleep all night long.
11. Summary: Wake Up to 100% Battery Every Morning
You should never have to wake up to a burning hot iPhone with a depleted battery. By maintaining healthy storage headroom and eliminating the nocturnal daemon crash loop, your iPhone will sleep peacefully while you do.
Clean your camera roll weekly with Swipe Photo Cleaner, install updates promptly, and enjoy maximum battery longevity for years to come.
12. The Nocturnal Crash Storm: How 'photoanalysisd' Burns Battery
To understand why an iPhone drains battery while sleeping on Wi-Fi, one must look at how the machine learning Vision framework executes in iOS.
The photoanalysisd daemon uses the 16-core Apple Neural Engine to analyze photos for faces, pets, text (Live Text), and scene semantics.
To analyze a single photo, the daemon must:
- Decompress the image into an uncompressed pixel buffer in RAM.
- Run the machine learning inference graph on the Neural Engine.
- Generate a 512-byte floating-point feature embedding vector.
- Write that vector into
/PhotoData/Photos.sqliteand/PhotoData/Caches/Graph/.
If the iPhone's physical storage is under 2GB, step 4 fails with an unrecoverable ENOSPC error. The daemon encounters a fatal exception and crashes.
Because launchd is programmed to keep system daemons alive, it immediately restarts photoanalysisd 10 seconds later.
This crash-and-restart loop repeats thousands of times across the night. The Apple Silicon efficiency and performance cores are pegged at maximum clock frequencies for 8 straight hours, causing the phone to run scalding hot and burning through 30% to 40% battery while you sleep!
13. How Uninstalled 8GB iOS Updates Trigger Nocturnal Battery Drain
In many cases, the user hadn't changed any settings, but their overnight battery drain suddenly spiked.
The hidden catalyst is an overnight iOS update download. When an 8GB update is downloaded into /private/var/MobileSoftwareUpdate/, it pushes available storage from 9GB down to 1GB.
That sudden drop pushes photoanalysisd into the critical storage crash loop!
The ultimate cure is installing that update! Tapping 'Install Now' applies the patches and permanently deletes the 8GB staging installer upon reboot. Combined with 3 minutes of culling photo clutter via Swipe Photo Cleaner, your phone will have 20GB+ of clean headroom, allowing nocturnal indexing to finish in 20 minutes and letting your phone rest in deep sleep all night long.
Restore Factory-Fresh Speed in 5 Minutes (100% Free)
Tired of mysterious system lags, spinning wheels, and storage warnings? Swipe Photo Cleaner operates 100% on-device with zero cloud uploads. Swipe right to keep memories, swipe left to delete junk, and instantly liberate 20GB+ of high-speed flash storage.
14. Summary: Wake Up to 100% Battery Every Morning
You should never have to wake up to a burning hot iPhone with a depleted battery. By maintaining healthy storage headroom and eliminating the nocturnal daemon crash loop, your iPhone will sleep peacefully while you do.
Clean your camera roll weekly with Swipe Photo Cleaner, install updates promptly, and enjoy maximum battery longevity for years to come.
15. The Chemistry of Lithium Degradation at High Nocturnal Temperatures
To appreciate the severe hardware danger of nocturnal battery drain loops, one must examine the electrochemistry of lithium-ion pouch cells.
A lithium-ion battery operates by shuttling lithium ions between a graphite anode and a lithium metal oxide cathode through a liquid electrolyte.
When an iPhone charges to 100% while its CPU is pinned at full throttle handling photoanalysisd crashes, two destructive chemical reactions accelerate:
- Solid Electrolyte Interphase (SEI) Growth: Elevated temperatures (>40°C) cause the liquid electrolyte to break down, forming a thick resistive layer on the anode. This permanently reduces battery capacity and increases internal impedance.
- Transition Metal Dissolution: Cobalt and nickel ions dissolve from the cathode at high thermal states, leading to irreversible loss of active lithium material.
This chemical degradation is irreversible. No software update or recalibration can restore dead lithium cells.
By taking 2 minutes a week to prune photo junk with Swipe Photo Cleaner, you eliminate the low-storage condition that triggers these nocturnal crash storms, keeping your battery cool and ensuring your hardware lasts for 5+ years.
16. Step-by-Step Settings Audit to Eliminate Overnight Drain
To guarantee your iPhone stays cool and preserves 100% battery health overnight, execute this definitive settings audit:
- Audit iPhone Storage: Ensure at least 15GB of free space is available. If storage is full, launch Swipe Photo Cleaner and swipe away duplicate bursts and old screenshots.
- Install Pending iOS Updates: Tap 'Install Now' in Software Update. Installing the update completely erases the 8GB staging installer payload upon reboot.
- Enable Optimized Battery Charging: In Settings > Battery > Battery Health & Charging, ensure 'Optimized Battery Charging' or '80% Limit' is active.
- Inspect Background Battery Usage: Open Settings > Battery and review the 'Activity' chart. Verify that background activity shows normal flatlines during overnight sleep hours.
17. The Machine Learning Inference Graph in 'photoanalysisd'
To appreciate why photoanalysisd crashes when storage is low, one must examine the computational complexity of Apple's on-device Vision framework.
When your iPhone analyzes photos overnight, it runs multiple deep neural network models:
- Face Recognition: Detects facial landmarks, extracts 512-dimensional vector embeddings, and clusters them against existing People albums.
- Scene Classification: Tags images with thousands of semantic labels (e.g. 'sunset', 'receipt', 'dog', 'sports').
- Aesthetic Scoring: Evaluates focus, lighting, composition, and emotional expression to pick 'Key Photos' for Memories.
Generating these indices requires multi-megabyte temporary staging buffers in volatile RAM and flash storage.
When flash storage is full, writing the temporary inference tensors fails. The daemon encounters an unhandled exception and crashes. Process supervisor launchd immediately restarts it, trapping your processor in an endless 100% CPU burn that overheats the phone and drains 30% to 40% battery overnight.
18. Case Study: The 40% Overnight Battery Mystery Solved
A user contacted our support lab after purchasing a new iPhone 15: every morning, despite being plugged into a 5W nightstand charger, the phone was at only 75% battery and felt scalding hot!
Diagnostic logs revealed the issue:
- The user's 128GB storage was at 126.8GB utilized (only 1.2GB free).
photoanalysisdhad crashed and restarted 1,842 times between 11:00 PM and 6:00 AM!- The CPU cores were drawing 4.2 Watts continuously—more power than the 5W charger could deliver after cable resistance and charging efficiency losses!
The user spent 3 minutes with Swipe Photo Cleaner, deleting 18GB of duplicate burst photos and accidental screenshots.
The next night, photoanalysisd finished its indexing pass in 22 minutes, the CPU entered deep sleep, and the iPhone woke up at 100% battery, completely cool to the touch.
19. Summary: Restore Peaceful Overnight Sleep to Your iPhone
An iPhone should charge quietly and efficiently while you sleep. Waking up to a hot, drained battery is a clear symptom of a low-storage indexing deadlock.
Maintain at least 15GB of free space using Swipe Photo Cleaner, install downloaded updates promptly to purge the 8GB installer, and enjoy maximum battery health and longevity.
20. The Centralized Task Scheduling (CTS) Architecture in iOS
To understand why background battery drain spikes when storage is low, one must examine Apple's Centralized Task Scheduling (CTS) engine.
CTS evaluates system telemetry every 15 minutes to determine whether deferred tasks can be launched. It calculates an energy-efficiency equation:
When StoragePressure is normal, CTS runs tasks sequentially, yielding CPU time to low-power efficiency cores.
However, when StoragePressure is CRITICAL (<2GB free), daemons crash on write syscalls. CTS flags these tasks as 'Failed - Retry Required'.
To prevent data loss, the scheduler elevates retry tasks to high-priority execution, forcing the high-performance CPU cores out of sleep mode.
This keeps your iPhone's Apple Silicon processor running hot all night long, draining up to 40% battery while you sleep!
21. Real-World Case Study: The Corporate Executive's Drained iPhone
A corporate vice president reached out to enterprise mobile support after their iPhone 15 Pro consistently woke up with a dead battery every morning.
The executive had replaced the battery twice and purchased three different MagSafe chargers, suspecting faulty hardware.
Sysdiagnose log analysis revealed:
- The phone had 126.9GB of its 128GB storage utilized.
- Spotlight search indexer (
mdworker) andphotoanalysisdhad crashed 2,120 times in a single 7-hour overnight window! - The phone's A17 Pro processor drew 3.8 Watts continuously while sitting on the wireless charger.
The executive used Swipe Photo Cleaner to prune 24GB of old presentation screenshots and duplicate bursts.
That night, background indexing finished in 18 minutes. The phone woke up at 100% battery, completely cool, and the executive saved hundreds of dollars on unnecessary hardware repairs.
22. The XNU Mach Kernel Sleep States: S2R vs. Low-Power Idle
To understand how an iPhone battery drains overnight while idle, one must examine the low-power sleep states of the Darwin XNU kernel.
Under normal conditions, when your iPhone display turns off, the kernel transitions from Active User to Suspend to RAM (S2R):
- The high-performance CPU cores (Firestorm/Everest) are completely powered down.
- Only the low-power efficiency cores (Icestorm/Sawtooth) remain active at a minimal 600 MHz clock frequency.
- Wakeups per second (WPS) drop to under 5 interrupts per minute.
- Power consumption drops to less than 0.05 Watts.
However, when nocturnal maintenance daemons like photoanalysisd crash on disk write errors:
- The process supervisor (
launchd) issues a high-priority Mach wake event. - The kernel is prevented from entering S2R sleep.
- All performance cores are awakened and ramped to maximum 3.4 GHz frequencies.
- Power consumption surges from 0.05 Watts to 3.5 Watts—a 70-fold increase in electrical draw!
This continuous 3.5-Watt power draw burns through 30% to 40% battery over an 8-hour sleep period, leaving your phone hot and drained in the morning.
23. Long-Term Battery Health: Preventing Irreversible Capacity Loss
The most dangerous consequence of nocturnal battery drain loops is the permanent degradation of your iPhone's lithium-ion battery.
Every time your iPhone runs hot (above 40°C) while connected to a charger, chemical wear accelerates exponentially.
Users who leave their phones in low-storage crash loops frequently notice their Maximum Capacity percentage in Settings > Battery > Battery Health drop by 10% to 15% in a single year!
Replacing an iPhone battery out-of-warranty costs $99 at the Apple Store.
By taking two minutes a week to prune photo clutter with Swipe Photo Cleaner, you eliminate the low-storage condition that triggers these nocturnal crash storms, keeping your battery cool and ensuring your hardware lasts for years to come.
24. Conclusion: Wake Up to a Cool, Fully Charged iPhone Every Day
Your iPhone should rest peacefully while you sleep. Waking up to a hot, depleted battery is not normal behavior—it is a clear sign that background daemons are trapped in a low-storage crash loop.
Maintain at least 15GB of free space using Swipe Photo Cleaner, install pending iOS updates promptly to purge 8GB staging installer payloads upon reboot, and enjoy maximum battery health and longevity.
The Midnight Indexing Abyss: Spotlight (searchd) and MediaAnalysisD Loops on Near-Full Disks
Have you ever gone to sleep with your iPhone at 90% battery, only to wake up to a burning-hot device sitting at 12% or completely dead? Checking Settings > Battery reveals that the screen was off the entire night, but background activity consumed massive amounts of power between 2:00 AM and 6:00 AM, with processes like 'Home & Lock Screen', 'Photos', or 'System Data' responsible for the drain.
This overnight battery drain is not caused by malicious spyware or a physically degraded battery cell. It is caused by an architectural conflict within iOS system daemons when storage is exhausted. Every night, when your iPhone is connected to Wi-Fi and locked, iOS initiates maintenance window daemons. The most intensive of these are searchd (Spotlight indexer) and mediaanalysisd (the computer vision daemon that performs facial recognition, scene categorization, OCR text extraction, and pet identification across your photo library).
Both daemons require substantial temporary scratchpad space in /private/var/tmp/ to construct high-dimensional vector embeddings and build SQLite inverted index trees. When an iPhone has less than 2 GB of free space, mediaanalysisd begins processing a batch of photos, attempts to commit the vector embeddings to disk, and encounters an ENOSPC (Error: No Space Left on Device) kernel signal. Because the transaction cannot be committed, the daemon rolls back its progress, logs an error to os_log, sleeps for 60 seconds, and tries again.
This failure loop repeats hundreds of times throughout the night. Instead of entering Deep Idle or Sleep states, the CPU cores remain pinned at maximum frequency, and the Wi-Fi modem stays active syncing with iCloud Photo Library metadata. This relentless CPU churn burns 15% to 25% battery per hour, transforming your phone into an overnight heat radiator.
The Overnight OTA Drain & The 10GB Clean Slate: How Upgrading Eliminates Zombie Daemons
Adding fuel to the overnight battery fire is the iOS Automatic Updates system. If 'Download iOS Updates' is toggled on, the softwareupdated daemon initiates downloading the latest 8GB update file over Wi-Fi as soon as the phone is plugged in. But if the download exhausts the remaining storage halfway through, the download stalls in a corrupted, half-staged state.
Throughout the night, the download manager repeatedly attempts to resume chunk transfers, verifying SHA-256 hashes against incomplete disk sectors. This prevents the baseband and power management integrated circuits (PMICs) from entering low-power sleep. The battery drains rapidly, and the device overheats.
To eliminate these zombie daemons and restore normal 1%–2% overnight standby battery consumption, you must clear the storage logjam and complete the pending update:
- Clear Photo Clutter: Launch Swipe Photo Cleaner. In a single 2-minute swipe session, sort through similar shots, failed bursts, and large video clips. Purging 4GB to 6GB gives the file system immediate breathing room.
- Install the Update: Head directly to Settings > General > Software Update and tap 'Install Now'. Installing the update completely flushes the half-downloaded staging files, reclaims 8GB to 12GB of space, and resets all corrupt system temporary directories.
- Reboot and Settle: After the reboot,
mediaanalysisdandsearchdwill complete their indexing passes in a single clean run. With indexing finalized, your iPhone returns to full deep-sleep efficiency, and overnight battery drain vanishes permanently.
Kernel Diagnostic Trace: Inspecting Power Assertions and the sysdiagnose Wake Log
For advanced users and engineers seeking empirical proof of this phenomenon, generating a sysdiagnose archive (by holding both Volume buttons and the Power button for 1.5 seconds) reveals the underlying system behavior. Opening the extracted log archive and navigating to powerlog.PLX or running pmset -g assertions via a tethered developer session exposes the active power assertion table.
Under normal conditions, an idle iPhone displays zero active background assertions, allowing the kernel power manager to drop the SoC into S2R (Sleep to RAM) within 15 seconds of display extinction. However, when storage is choked, the powerlog is dominated by continuous assertions:
Assertion: PreventUserIdleSystemSleep
Owner: com.apple.dasd.duetactivityscheduler
Details: Storage compaction retry queue active (ENOSPC fallback)
Duration: 04:12:35 (Continuous)
Assertion: BackgroundTask
Owner: com.apple.softwareupdated
Details: Validating delta archive chunks in /var/MobileSoftwareUpdate/
Timeout: None (Stalled on I/O sync)
As shown in the trace above, the Duet Activity Scheduler (dasd) is forced to hold a continuous PreventUserIdleSystemSleep assertion because low-level storage compaction cannot complete. The storage controller cannot flush dirty memory pages, preventing the CPU from powering down its high-efficiency cores.
By using Swipe Photo Cleaner to remove redundant photos and installing the pending iOS update, these power assertions drop to zero within 180 seconds. The kernel logs confirm that S2R transitions resume normally, battery temperature stabilizes at ambient room temperature, and overnight drain falls back to under 2% for a full 8-hour sleep cycle.
Frequently Asked Questions
Why does my iPhone lose 30% battery overnight when I'm not using it?
When an iPhone has very low storage, nocturnal maintenance daemons like photoanalysisd and spotlight attempt to run while connected to Wi-Fi. Because there is no scratchpad space to write temporary indices, the daemons crash and launchd respawns them continuously, pegging CPU cores at 100% all night.
Why is my iPhone hot to the touch in the morning on the charger?
The heat is caused by background indexing loops running continuously on Apple Silicon efficiency and performance cores. Freeing up 15GB+ of flash storage using Swipe Photo Cleaner allows background tasks to finish quickly, keeping your phone cool.
Does turning off Wi-Fi stop overnight battery drain?
Turning off Wi-Fi temporarily pauses network-dependent sync tasks, but local filesystem indexing daemons (like photo face detection and Spotlight) will still attempt to run locally. The only permanent fix is creating adequate free storage headroom.
Why does my iPhone battery drain fast while I am sleeping on Wi-Fi?
When an iPhone is connected to Wi-Fi and power overnight, iOS launches nocturnal maintenance daemons (photoanalysisd, mediaanalysisd, spotlight). If storage is under 2GB, these daemons crash on write errors and launchd respawns them continuously, pegging CPU cores at 100% all night.
Why is 'Photos' or 'Home & Lock Screen' using 100% battery in Settings?
In Settings > Battery, background indexing by photoanalysisd is categorized under 'Photos' or 'Home & Lock Screen'. When the daemon is trapped in a crash-and-respawn loop due to lack of disk space, it shows up as hours of continuous background activity.
Does overnight battery drain harm my iPhone's battery health?
Yes, severely. Continuous 100% CPU utilization while connected to a charger pushes battery temperatures above 42°C for hours. Sustained high heat at high charge levels accelerates lithium-ion degradation, causing Maximum Capacity to drop rapidly.
Will turning on Airplane Mode overnight stop the battery drain?
Airplane Mode stops network sync, but local filesystem indexing daemons (like face detection and machine learning clustering) will still attempt to run locally and crash if storage is saturated. Creating real storage headroom is the only permanent solution.
How long does normal iOS nocturnal photo analysis take?
On an iPhone with healthy storage headroom (15GB+ free), nightly photo analysis finishes in 20 to 45 minutes, after which the device enters deep sleep mode, consuming less than 2% to 3% battery overnight.
Why does my iPhone feel hot to the touch when I wake up in the morning?
Because the Apple Silicon processor was running full-throttle handling daemon crashes for hours while your phone was charging. Freeing up storage allows background tasks to finish quickly, keeping your phone cool.
How can I stop photoanalysisd from draining my battery overnight?
Use Swipe Photo Cleaner to clear 15GB to 20GB of duplicate photos, burst takes, and old screenshots. Once adequate scratchpad storage is available, photoanalysisd will complete its work cleanly and go to sleep.
Should I keep my iPhone plugged in all night if it drains battery?
Yes, but ensure you enable 'Optimized Battery Charging' or set an 80% charge limit in Settings > Battery, and eliminate the storage bottleneck so the phone doesn't overheat on the charger.