Facebook’s iOS apps might be draining your battery

After experiencing unusual battery drain on his iPhone 4S, a developer began an investigation to find what was it that was causing the drain. For this he used Instruments, an Apple built tool to profile and analyse Mac and iOS applications, and he found something very surprising.

Facebook’s iOS app woke up from the background every few minutes, did something for a few seconds and went back to sleep, causing the battery to drain very quickly.

Sebastian Düvel, the developer, started debugging the battery drain by observing the CPU time taken by processes running on his iPhone, and found that Facebook accounted for the most usage, even more than system processes.

facebook cpu time

He continued his analysis, keeping in mind that Facebook Messenger does VoIP and audio, both of which require an app to stay awake in the background. After letting Instruments profile process’ sleep/awake patterns for two hours, Düvel found that Facebook wakes up from background every few minutes to occupy the CPU for some seconds and goes back to sleeping. This pattern is depicted by the flags in the image below:

facebook sleep awake patterns

The pattern remained the same even with chat disabled in the main Facebook app. Facebook Messenger and the main Facebook app running on the iPad exhibited the same behaviour. The reason the app wakes up isn’t known yet, though some people speculate that it’s to connect to Facebook’s servers to report active/idle status in Facebook chat.

You can avoid the drain either by deleting Facebook’s iOS apps from your device, or force closing the apps each time after you use it. You could also use Facebook’s mobile website (and pin it to your homescreen), which doesn’t have background privileges.

Try this and do tell us in the comments below if you’ve noticed any improvements in your battery life, especially if you’re a heavy Facebook user.

Via: Reddit