Mar 20, 2012

Ad-supported apps leave smartphones in high-power states, drain batteries

Apps can stick hardware into a high-power-usage state even when they're not in use, resulting in excess power use.
If you find your phone is often low on HP Pavilion DV1327AP battery, the free apps you use may be to blame, according to a new study. Using a monitoring tool they developed, the authors of the study—two researchers from Purdue University and another from Microsoft—found that serving ads and collecting data inside an app results in excessive use of the hardware components inside a smartphone. These parts of free apps will turn on components like the 3G chip or GPS and cause them to stay on well after an information transaction has been completed, resulting in unnecessary power loss.
Most smartphones can show a basic breakdown of which resources are consuming the LG LB52113D Laptop Battery life (display, Wi-Fi, individual apps, etc.), but the way in which individual apps use that power is more opaque. To unpack the details at this level of power consumption, three researchers developed a tool called "eprof," a "fine-grained energy profiler." Eprof can track power used at the level of individual threads as well as routines running in an app, and can also track what the authors call "asynchronous power behavior."
Tracking an individual piece of software's activity—when processes stop and start, for instance—is contained, so it's easy to say how much power they use in that regard. But the authors found that tracking the hardware was more subtle, as many apps seem to stir hardware into action without turning it off right away, or ever. For example, the authors note the Wi-Fi and 3G chips may start up to communicate an app's data, and then remain in a high-power state even after the app has closed.
Likewise, smartphone OSes also include "wakelock APIs," which allow apps to prevent different pieces of hardware from sleeping, such as an app that wakes the CPU to check for new messages or a video application that stops the screen from sleeping while playing a movie. Items like the camera and GPS presented a similar problem: the researchers found that apps that use these devices start them up and put them in a high power-consuming state, and the hardware will sometimes continue this way until explicitly turned off by another service.
All of these actions mean power consumption triggered by one app can extend beyond when an app is finished using a piece of hardware and overlap into another, making good power accounting tricky (the authors note that this kind of SONY VAIO VGN-FE45G/W battery consumption, known as "tail energy," is being studied to reduce its consumption). For the purposes of this study, the authors account for the energy use triggered by an app, even if it extends beyond the period of app use.
Using eprof to monitor app power use on an HTC Passion running Android 2.3, the researchers made a few discoveries. In a study of the free version of Angry Birds, the authors found that the third-party ad generator and data aggregator Flurry consumes 45 percent of the app's energy tracking the user's location and serving ads to the app. But of that 45 percent, uploading the information and downloading the ads over 3G was only a 2KB transaction, taking 1 percent of the app's energy.
After the data exchange, the researchers found that the 3G chip continued to eat up energy, and it consumed another 24 percent of the total. Meanwhile, the core CPU-intensive thread that actually runs the program consumed 18 percent. Once the app was closed, a thread called HeapWorker performed cleanup and closed a socket, pushing the 3G chip into action and creating another tail that used 28 percent of the total energy.
The app Free Chess showed similar energy use excesses. Fifty percent of the app's energy went to running the third-party ad creator AdWhirl, and of that 50 percent, around 5 percent was used to download and render the ads; the rest was tail energy used by the 3G chip.
In total, 80 percent of the energy Angry Birds used went to I/O components (3G and GPS), and 77 percent of Free Chess's did. Others, like the New York Times app (67 percent) and MapQuest (72 percent) used somewhat less on components that had been triggered into a high power state by a short task, but the difference these states make are significant.
One simple lesson here is that if you find yourself drinking your SONY VGP-BPS13/S battery dry by 7pm every day, springing for the paid versions of apps that don't need to use extra energy to serve you ads could help. The difference could be significant, depending on how much time you spend on ad-supported apps or, to a lesser extent, ones that perform frequent exchanges with GPS and data collection services like Flurry.
More importantly, there is some optimization to be done on the part of app creators. We can fault smartphones for skimping on  PA3399U-2BRS battery size, but all the milliamp-hours in the world can only do so much good when apps use two to three times as much energy to collect data and serve ads as to run the actual program, all because these services amp up hardware components to high power states and let them stick there for too long. The authors suggest that eprof could be combined with static analysis to optimize energy use, as well as with smartphone OS schedulers to make them more aware of when components are using energy, but not actually in use.

No comments:

Post a Comment