Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correlation between Memory Usage of Processes and battery Consumption Android

Tags:

android

I've finally figured out a way to get TotalPss for individual processes. Now what I am concerned about is, how to find battery consumption per android process, and if there is no direct way of finding that out, is there any correlation between the memory usage per process and the battery consumption? Any research paper that I can look into for that?

like image 880
Jonathan Avatar asked Oct 16 '12 00:10

Jonathan


2 Answers

Yes, there is a positive correlation between memory usage, in terms of number of memory accesses, and energy consumption. In other words, the more memory is accessed, the more energy will be consumed.

However, the consumption of energy is largely dominated by the energy usage of the other hardware components that the application is interacting with (e.g., CPU, display, radios, GPS, etc.) as its executing via the Android platform APIs, virtual machine, and OS. This is because memory isn't used in a vacuum, and research has shown that RAM consumes relatively little energy when compared to other hardware components used as an app is executing. In other words, if a memory access is occurring, its because the CPU is executing, which consumes more energy than if the CPU was in an idle state.

For example, consider this following quote based on tests on the HTC Dream (G1) and Nexus One devices, from:

[29] Aaron Carroll and Gernot Heiser, "An analysis of power consumption in a smartphone," presented at the Proceedings of the 2010 USENIX conference on USENIX annual technical conference, Boston, MA, 2010. http://www.nicta.com.au/pub?doc=3587

"The RAM, audio and flash subsystems consistently showed the lowest power consumption. While our micro-benchmarks showed that the peak power of the SD card could be substantial ( 50 mW), in practice the utilisation is low enough such that on average, negligible power is consumed. Even video playback, one of the more data-intensive uses of mobile devices, showed SD power well under 1 % of total power. RAM has similar characteristics; micro-benchmarks showed that RAM power can exceed CPU power in certain workloads, but in practical situations, CPU power overshadows RAM by a factor of two or more. Audio displayed a largely static power consumption in the range of 28–34 mW. Overall, RAM, audio and SD have little effect on the power consumption of the device, and therefore offer little potential for energy optimisation."

As this and other papers say (see my full reference list at the end of this post), energy consumption depends on application use-case scenarios, and the frequency and duration of the use of other hardware components during execution by both your application and other applications that are being context-switched in and out as your app executes.

Measuring energy consumption purely from software is very difficult. The Epof paper mentioned by Kristopher is probably the most recent and complete effort I've seen in this area:

[38] Abhinav Pathak, Y. Charlie Hu, and Ming Zhang (2012), "Fine Grained Energy Accounting on Smartphones with Eprof," in EuroSys'12, Bern, Switzerland, April 10-13, 2012. http://research.microsoft.com/en-us/people/mzh/eurosys-2012.pdf

As of early 2012 the authors were planning on releasing their software as open-source later in the year, but I don't know where this currently stands.

Another paper to examine is the one that produced the PowerTutor app on Google Play, which was a collaboration between the University of Michigan and Google:

[34] Lide Zhang, Birjodh Tiwana, Zhiyun Qian, Zhaoguang Wang, Robert P. Dick, Zhuoqing Morley Mao, and Lei Yang, "Accurate online power estimation and automatic battery behavior based power model generation for smartphones," presented at the Proceedings of the eighth IEEE/ACM/IFIP international conference on Hardware/software codesign and system synthesis, Scottsdale, Arizona, USA, 2010. http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en/us/pubs/archive/39990.pdf

They do software-only energy usage modeling, but to produce accurate results a model must first be developed on a particular device using more than just software.

If you're asking about the correlation between the amount of memory consumed by a process and energy usage, I don't recall coming across a paper that measured this specifically. However, typically I would think that a process with larger memory consumption would also require more CPU cycles to execute to utilize this memory, which would result in larger energy consumption.

I wrapped up my dissertation on intelligent mobile software to conserve energy for location-based services earlier this year, and read a bunch of papers on mobile energy consumption and profiling in the process. Below are the references I cited that also discuss general energy consumption in context of mobile apps, in case they are useful.

[26] Jeff Sharkley (2009), "Coding for Life--Battery Life, That Is," in Google I/O 2009, San Francisco, CA, May 27, 2009. http://www.google.com/events/io/2009/sessions/CodingLifeBatteryLife.html

[27] Robert Mayo and Parthasarathy Ranganathan, "Energy Consumption in Mobile Devices: Why Future Systems Need Requirements–Aware Energy Scale-Down - Power-Aware Computer Systems." Vol. 3164, B. Falsafi and T. VijayKumar, Eds., ed: Springer Berlin / Heidelberg, 2005, pp. 301-463. Link

[28] Gerard Bosch Creus and Mika Kuulusa, Optimizing Mobile Software with Built-in Power Profiling: Springer, 2007. Link

[29] Aaron Carroll and Gernot Heiser, "An analysis of power consumption in a smartphone," presented at the Proceedings of the 2010 USENIX conference on USENIX annual technical conference, Boston, MA, 2010. http://www.nicta.com.au/pub?doc=3587

[30] Aqeel Mahesri and Vibhore Vardhan, "Power Consumption Breakdown on a Modern Laptop - Power-Aware Computer Systems." Vol. 3471, B. Falsafi and T. VijayKumar, Eds., ed: Springer Berlin / Heidelberg, 2005, pp. 165-180. Link

[31] Rajesh Palit, Ajit Singh, and Kshirasagar Naik, "Modeling the energy cost of applications on portable wireless devices," presented at the Proceedings of the 11th international symposium on Modeling, analysis and simulation of wireless and mobile systems, Vancouver, British Columbia, Canada, 2008. http://dl.acm.org/citation.cfm?id=1454562

[32] T. Farrell, R. Lange, and K. Rothermel (2007), "Energy-efficient Tracking of Mobile Objects with Early Distance-based Reporting," in Mobile and Ubiquitous Systems: Networking & Services, 2007. MobiQuitous 2007. Fourth Annual International Conference on, pp. 1-8, 6-10 Aug. 2007. Link

[34] Lide Zhang, Birjodh Tiwana, Zhiyun Qian, Zhaoguang Wang, Robert P. Dick, Zhuoqing Morley Mao, and Lei Yang, "Accurate online power estimation and automatic battery behavior based power model generation for smartphones," presented at the Proceedings of the eighth IEEE/ACM/IFIP international conference on Hardware/software codesign and system synthesis, Scottsdale, Arizona, USA, 2010. http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en/us/pubs/archive/39990.pdf

[35] J. Eberle and G. P. Perrucci (2011), "Energy measurements campaign for positioning methods on State-of-the-Art smartphones," in Consumer Communications and Networking Conference (CCNC), 2011 IEEE, pp. 937-941, 9-12 Jan. 2011. Link

[36] M. Kjaergaard (2012), "Minimizing the Power Consumption of Location-Based Services on Mobile Phones," Pervasive Computing, IEEE, Vol. 11 pp. 67-73. Link

[38] Abhinav Pathak, Y. Charlie Hu, and Ming Zhang (2012), "Fine Grained Energy Accounting on Smartphones with Eprof," in EuroSys'12, Bern, Switzerland, April 10-13, 2012. http://research.microsoft.com/en-us/people/mzh/eurosys-2012.pdf

like image 149
Sean Barbeau Avatar answered Dec 08 '22 23:12

Sean Barbeau


There is no correlation between memory usage and battery use. It takes the same amount of energy to store "nothing" as it does "something" in memory.

If there is a lot of reading and writing going on, then yes it does affect it, but just being there doesn't.

like image 41
KGardevoir Avatar answered Dec 09 '22 00:12

KGardevoir