So, you have just rooted your new Android device and installed CPU Spy Reloaded on it. It looks all pretty and geeky and all but you have no idea how to use it. Right? Then this is the right place for you. Let me welcome you to the geeky world of CPU statistics.
You flagship Android device is a monster. It’s more powerful than an average PC. That’s all great, so what’s the problem? It’s your battery, it’s no monster, not even close. The evolution of batteries is much slow when compared to the evolution of microchips.
What does that mean? It means that if your android device is running at its full power all the time, your precious battery charge will be gone in couple hours or less. So what does device manufacturers do? How do we solve this? Here comes the significance of CPU States. They are just different speeds at which your device could run. For example, if your devices maximum speed is 2000MHz (2GHz), your devices’ CPU States might be 250MHz, 500MHz, 750MHz, 1000MHz, 1250MHz, 1500MHz, 1750MHz and 2000MHz of course.
So suppose you are scrolling through the apps in your phone. That doesn’t require much work. So you CPU will probably be using 250MHz or 500MHz state. Then you decided to play a video. That requires a bit more work, so your device will switch to 1000MHz or so. Now, if you are playing very sophisticated game or running a torrent, the CPU will have no choice but to run at 2000MHz, consuming more power.
All this switching is handled by a special program inbuilt into your device called CPU governor. The default governor for Android devices right now is “interactive”, which is excellent at saving power. There are many other governors available and you can install/enable them if you are rooted. CPU governors are a big topic. Maybe I’ll talk about it later, but right now all you need to know is that an ideal governor will save maximum power without affecting performance.
Then again, if you just powered of the screen, and left you phone alone, your CPU should go into a state called Deep Sleep. That means it’s nearly not using any power at all. This is really important because if your device is not attaining deep sleep properly, your battery will take a hard hit.
Who would do such a nasty thing right? Who would dare to disturb your device that’s sleeping so peacefully? Short answer – low quality or rogue apps. How do they do it? Short answer- wake locks.
So, let’s say you have an email app. This app has to check the server now and then, maybe every 10 minutes for new mail. Right? Suppose your device is sleeping when this app have scheduled an email check. What would it do? It might be an important email. So it wakes up the device. But that’s not enough. The device shouldn’t go back to sleep while the app is downloading emails. So what would the app do now? It would acquire a thing called wake lock. This is something like a token. As long as the app holds this token, the device can’t go back to sleep. So, when the app is done checking emails, it will release the wake lock and the device will go back to sleep.
This is the correct way an app would function. So what if an app acquires a wake lock and forgets to release it? Or what if it’s waking up the device every 2 seconds? You already know the answer.
So now the real question. How do we detect these nasty apps? Here’s where CPU Spy Reloaded comes in.
CPU State Charts
This screenshot was taken from my Galaxy S4. In the first chart, the pie chart, you can see that Deep Sleep takes up only 42.9 % of the whole time the since the device booted up. Same results are shown as a bar chart in the second screen. If you use your device normally for 1 – 2 days, even with occasional charging, deep sleep should be somewhere above 60 %. So something is definitely wrong. Let’s take a look at the wake lock stats and see what’s causing this.
Wake lock statistics
Let’s look at the top packages in this chart.
1. Google Play Services
This one is the top of the chart for a reason. Google Cloud Messaging. “Approximately 60 percent of apps in Google Play are said to be now using the service at a rate of 17 billion messages sent per day.” – zdnet.com. Basically, most of your instant messaging and social network apps are using this service to get messages and push notifications to your device. By pooling these network polls together Google Play Services save more battery than any of those battery saving you have currently installed on your phone.
I haven’t opened Vine in weeks now. I’m not that active on Vine either. There is no reason why it should acquire 3689 wake locks. I sometimes enjoy watching hilarious videos on Vine but they should optimize the app more. Uninstalled.
3, 4 and 7 – Facebook messenger, Facebook and Facebook lite
Combined, these apps take 3214 wake locks. This was a brilliant strategy from Facebook. Separating messenger from the main Facebook app gave them two apps with half battery usage instead of a single app that eats away a huge chunk of battery. An excellent way to avoid getting bashed for high battery usage. But still, they have improved a lot over the years. Once again, I haven’t opened these apps in days, these apps wouldn’t be using so much battery in M because of the Doze feature.
5. Android System
These are probably wake locks needed for critical system tasks. Don’t worry too much about them unless you are using custom ROMs/Kernels.
Chrome is at 6 because I’ve been using it a lot.
Okay guys, that’s how we find out who the battery thief is. I hope you found this article and the app useful. If you have any doubts, please mention in the comments below. Have a nice day and do not let those nasty apps get away with your battery.