Skip to main content

Advertisement

Log in

An exploratory study on assessing the energy impact of logging on Android applications

  • Published:
Empirical Software Engineering Aims and scope Submit manuscript

Abstract

Execution logs are debug statements that developers insert into their code. Execution logs are used widely to monitor and diagnose the health of software applications. However, logging comes with costs, as it uses computing resources and can have an impact on an application’s performance. Compared with desktop applications, one additional critical computing resource for mobile applications is battery power. Mobile application developers want to deploy energy efficient applications to end users while still maintaining the ability to monitor. Unfortunately, there is no previous work that study the energy impact of logging within mobile applications. This exploratory study investigates the energy cost of logging in Android applications using GreenMiner, an automated energy test-bed for mobile applications. Around 1000 versions from 24 Android applications (e.g., Calculator, FeedEx, Firefox, and VLC) were tested with logging enabled and disabled. To further investigate the energy impacting factors for logging, controlled experiments on a synthetic application were performed. Each test was conducted multiple times to ensure rigorous measurement. Our study found that although there is little to no energy impact when logging is enabled for most versions of the studied applications, about 79% (19/24) of the studied applications have at least one version that exhibit medium to large effect sizes in energy consumption when enabling and disabling logging. To further assess the energy impact of logging, we have conducted a controlled experiment with a synthetic application. We found that the rate of logging and the number of disk flushes are significant factors of energy consumption attributable to logging. Finally, we have examined the relation between the generated OS level execution logs and mobile energy consumption. In addition to the common cross-application log events relevant to garbage collection and graphics systems, some mobile applications also have workload-specific log events that are highly correlated with energy consumption. The regression models built with common log events show mixed performance. Mobile application developers do not need to worry about conservative logging (e.g., logs generated at rates of ≤ 1 message per second), as they are not likely to impact energy consumption. Logging has a negligible effect on energy consumption for most of the mobile applications tested. Although logs have been used effectively to diagnose and debug functional problems, it is still an open problem on how to leverage software instrumentation to debug energy problems.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

References

  • Aggarwal K, Hindle A, Stroulia E (2015) Greenadvisor: a tool for analyzing the impact of software evolution on energy consumption. In: 2015 IEEE international conference on software maintenance and evolution (ICSME), pp 311–320

  • Aggarwal K, Zhang C, Campbell JC, Hindle A, Stroulia E (2014) The power of system call traces: Predicting the software energy consumption impact of changes. In: Proceedings of the 2014 conference of the center for advanced studies on collaborative research (CASCON)

  • Alam F, Panda PR, Tripathi N, Sharma N, Narayan S (2014) Energy optimization in android applications through wakelock placement. In: 2014 design, automation test in europe conference exhibition (DATE), pp 1–4

  • Android Open Source Project. Andriod API For logging. http://developer.android.com/reference/android/util/log.html. Last accessed 02/10/2015

  • Android Open Source Project. Logcat. http://developer.android.com/tools/help/logcat.html. Last accessed 02/10/2015

  • Banerjee A, Chong LK, Chattopadhyay S, Roychoudhury A (2014) Detecting energy bugs and hotspots in mobile apps. In: FSE 2014. Hong Kong, China, pp 588–598

  • Benjamini Y, Hochberg Y (1995) Controlling the false discovery rate: a practical and powerful approach to multiple testing. J R Stat Soc Ser B (Methodol) 57(1):289–300

    MathSciNet  MATH  Google Scholar 

  • Carroll A, Heiser G (2010) An analysis of power consumption in a smartphone. In: Proceedings of the USENIXATC’10

  • Chowdhury S, Varun S, Hindle A (2016) Client-side energy efficiency of HTTP/2 for web and mobile app developers. In: SANER ’16. Osaka, Japan

  • Chowdhury SA, Hindle A (2016) Characterizing energy-aware software projects: are they different?. In: Proceedings of the 13th international conference on mining software repositories, MSR ’16. ACM, New York, NY, USA, pp 508–511

  • Chowdhury SA, Hindle A (2016) Greenoracle: estimating software energy consumption with energy measurement corpora. In: Proceedings of the 13th international conference on mining software repositories (MSR)

  • Chukwa - hadoop wiki. http://wiki.apache.org/hadoop/chukwa. Last accessed 04/18/2015

  • Ding R, Zhou H, Lou J-G, Zhang H, Lin Q, Fu Q, Zhang D, Xie T (2015) Log2: a cost-aware logging mechanism for performance diagnosis. In: 2015 USENIX annual technical conference (USENIX ATC)

  • Dong M, Zhong L (2011) Self-constructive high-rate system energy modeling for battery-powered mobile systems. In: Proceedings of the MobiSys ’11, pp 335–348

  • Fedotyev A (2014) The real cost of logging. http://blog.appdynamics.com/net/the-real-cost-of-logging/. Last accessed 04/18/2015

  • Flinn J, Satyanarayanan M (1999) Powerscope: a tool for profiling the energy usage of mobile applications. In: WMCSA ’99. New Orleans, Louisiana, USA, pp 2–10

  • Fu Q, Zhu J, Hu W, Lou J-G, Ding R, Lin Q, Zhang D, Xie T (2014) Where do developers log? An empirical study on logging practices in industry. In: Companion proceedings of the 36th international conference on software engineering, ICSE companion 2014

  • Georges A, Buytaert D, Eeckhout L (2007) Statistically rigorous java performance evaluation. In: Proceedings of the 22nd annual ACM SIGPLAN conference on object-oriented programming systems and applications (OOPSLA)

  • Grabner A (2012) Top performance mistakes when moving from test to production: excessive logging. http://tinyurl.com/q9odfsm. Last accessed 04/18/2015

  • Group TO Application response measurement - ARM. https://collaboration.opengroup.org/tech/management/arm/, visited 2014-11-24

  • Gurumurthi S, Sivasubramaniam A, Irwin MJ, Vijaykrishnan N, Kandemir M, Li T, John LK (2002) Using complete machine simulation for software power estimation: the softwatt approach. In: Proceedings of the 8th international symposium on high-performance computer architecture, HPCA ’02, pp 141– 150

  • Hao S, Li D, Halfond WGJ, Govindan R (2013) Estimating mobile application energy consumption using program analysis. In: ICSE ’13, pp 92–101

  • Hasan S, King Z, Hafiz M, Sayagh M, Adams B, Hindle A (2016) Energy profiles of java collections classes. In: Proceedings of the 38th International Conference on Software Engineering, ICSE ’16. ACM, New York, NY, USA, pp 225–236

  • Hindle A (2013) Green mining: a methodology of relating software change and configuration to power consumption. Empir Softw Eng 20(2):374–409

    Article  Google Scholar 

  • Hindle A, Wilson A, Rasmussen K, Barlow EJ, Campbell JC, Romansky S (2014) Greenminer: a hardware based mining software repositories software energy consumption framework. In: Proceedings of the 11th working conference on mining software repositories (MSR)

  • Hlavac M (2015) Stargazer: well-formatted regression and summary statistics tables. Harvard University, Cambridge, USA. R package version 5.2

  • Hopkins WG (2016) A new view of statistics. [online accessed 2017-01-15] http://www.sportsci.org/resource/stats/index.html

  • Jabbarvand R, Sadeghi A, Bagheri H, Malek S (2016) Energy-aware test-suite minimization for android apps. In: Proceedings of the 25th international symposium on software testing and analysis, ISSTA 2016, pp 425–436

  • Jay A Do unused logging statements affect performance in android apps? Stack overflow http://tinyurl.com/ncf2nl9

  • Jay A Log.d and impact on performance. Stack overflow http://stackoverflow.com/questions/3773252/log-d-and-impact-on-performance. Last accessed 04/18/2015

  • Jiang ZM, Hassa AE, Hamann G, Flora P (2008) An automated approach for abstracting execution logs to execution events. Journal Software Maintenance Evolution 20:249–267

    Article  Google Scholar 

  • Jiang ZM, Hassan AE, Hamann G, Flora P (2008) Automatic identification of load testing problems. In: Proceedings of the 24th IEEE international conference on software maintenance (ICSM)

  • Jojo. Does logging slow down a production android app? Stack overflow http://stackoverflow.com/questions/6445153/does-logging-slow-down-a-production-android-app. Last accessed 04/18/2015

  • Kalibera T, Jones R (2013) Rigorous benchmarking in reasonable time. In: Proceedings of the 2013 international symposium on memory management (ISMM)

  • Li D, Hao S, Gui J, William H (2014) An empirical study of the energy consumption of android applications. In: Proceedings of the 30th international conference on software maintenance and evolution (ICSME)

  • Li D, Hao S, Halfond WGJ, Govindan R (2013) Calculating source line level energy information for android applications. In: Proceedings of the 2013 international symposium on software testing and analysis (ISSTA)

  • Li D, Jin Y, Sahin C, Clause J, Halfond WGJ (2014) Integrated energy-directed test suite optimization. In: Proceedings of the 2014 international symposium on software testing and analysis (ISSTA)

  • Li D, Lyu Y, Gui J, Halfond WGJ (2016) Automated energy optimization of http requests for mobile applications. In: Proceedings of the 38th international conference on software engineering, ICSE ’16. ACM, New York, NY, USA, pp 249–260

  • Liu Y, Xu C, Cheung S, Terragni V (2016) Understanding and detecting wake lock misuses for android applications. In: FSE 2014. Seattle, WA, USA

  • Logstash - open source log management. http://logstash.net/. Last accessed 04/18/2015

  • Manotas I, Bird C, Zhang R, Shepherd D, Jaspan C, Sadowski C, Pollock L, Clause J (2016) An empirical study of practitioners’ perspectives on green software engineering. In: Proceedings of the 38th international conference on software engineering, ICSE ’16. ACM, New York, NY, USA , pp 237–248

  • Mytkowicz T, Diwan A, Hauswirth M, Sweeney PF (2009) Producing wrong data without doing anything obviously wrong!. In: Proceedings of the 14th international conference on architectural support for programming languages and operating systems (ASPLOS)

  • Neill J (2008) Why use effect sizes instead of significance testing in program evaluation. http://www.wilderdom.com/research/effectsizes.html

  • Oliner A, Ganapathi A, Xu W (2012) Advances and challenges in log analysis. Commun ACM 55(2):55– 61

    Article  Google Scholar 

  • Pang C, Hindle A, Adams B, Hassan AE (2016) What do programmers know about software energy consumption?. IEEE Softw 33(3):83–89

    Article  Google Scholar 

  • Pathak A, Hu YC, Zhang M (2011) Bootstrapping energy debugging on smartphones: a first look at energy bugs in mobile devices. In: Proceedings of the 10th ACM workshop on hot topics in networks, HotNets-X, pp 5:1–5:6

  • Pathak A, Hu YC, Zhang M (2012) Where is the energy spent inside my app?: fine grained energy accounting on smartphones with eprof. In: EuroSys ’12. Bern, Switzerland, pp 29–42

  • Pathak A, Hu YC, Zhang M, Bahl P, Wang Y. -M. (2011) Fine-grained power modeling for smartphones using system call tracing. In: Eurosys ’11. Salzburg, Austria, pp 153–168

  • Patil PS, Doshi J, Ambawade D (2015) Reducing power consumption of smart device by proper management of wakelocks. In: Advance computing conference (IACC), 2015 IEEE international , pp 883–887

  • Pinto G, Castor F, Liu YD (2014) Mining questions about software energy consumption. In: Proceedings of the 11th working conference on mining software repositories (MSR)

  • Rasmussen K, Wilson A, Hindle A (2014) Green mining: energy consumption of advertisement blocking methods. In: Proceedings of the 3rd international workshop on green and sustainable software, GREENS 2014, pp 38–45

  • Replication Package Android Logcat Energy Study. https://archive.org/details/replicationpackageandroidlogcatenergystudy. Last accessed 05/24/2017

  • Romano J, Kromrey JD, Coraggio J, Skowronek J (2006) Appropriate statistics for ordinal level data: should we really be using t-test and Cohen’s d for evaluating group differences on the NSSE and other surveys?. In: Annual meeting of the florida association of institutional research

  • Romansky S, Hindle A (2014) On improving green mining for energy-aware software analysis. In: Proceedings of the 2014 conference of the center for advanced studies on collaborative research (CASCON)

  • Sahin C, Pollock L, Clause J (2014) How do code refactorings affect energy usage?. In: Proceedings of the 8th ACM/IEEE international symposium on empirical software engineering and measurement (ESEM)

  • Sahin C, Tornquist P, McKenna R, Pearson Z, Clause J (2014) How does code obfuscation impact energy usage?. In: Proceedings of the 30th IEEE international conference on software maintenance and evolution (ICSME)

  • Sandalone. Android debugging - > battery drains. Stack Overflow http://stackoverflow.com/questions/4958543/android-debugging-battery-drains. Last accessed 04/18/2015

  • Seo C, Malek S, Medvidovic N (2008) Component-level energy consumption estimation for distributed java-based software systems. Volume 5282 of Lecture Notes in Computer Science. Springer, Berlin, pp 97–113

    Google Scholar 

  • Shang W, Jiang ZM, Adams B, Hassan AE, Godfrey MW, Nasser M, Flora P (2011) An exploratory study of the evolution of communicated information about the execution of large software systems. In: Proceedings of the 18th working conference on reverse engineering (WCRE)

  • Shang W, Jiang ZM, Hemmati H, Adams B, Hassan AE, Martin P (2013) Assisting developers of big data analytics applications when deploying on hadoop clouds. In: Proceedings of the 35th international conference on software engineering (ICSE)

  • Shang W, Nagappan M, Hassan AE (2015) Studying the relationship between logging characteristics and the code quality of platform software. Empir Softw Eng 20 (1):1–27

    Article  Google Scholar 

  • Shye A, Scholbrock B, Memik G (2009) Into the wild: studying real user activity patterns to guide power optimizations for mobile architectures. In: IEEE/ACM MICRO 42. New York, NY, USA, pp 168–178

  • Sigelman BH, Barroso LA, Burrows M, Stephenson P, Plakal M, Beaver D, Jaspan S, Shanbhag C (2010) Dapper, a large-scale distributed systems tracing infrastructure. Technical report, Google Inc.

  • Splunk. http://www.splunk.com/. Last accessed 04/18/2015

  • Summary of Sarbanes-Oxley Act of 2002. http://www.soxlaw.com/

  • Texas Instruments, Dallas, USA (2015) INA219 Zerø-drift bidirectional current/power monitor with I2C interface. http://www.ti.com/lit/ds/symlink/ina219.pdf

  • Thompson B (2000) A suggested revision to the forthcoming 5th edition of the APA publication manual. http://people.cehd.tamu.edu/~bthompson/apaeffec.htm

  • Vásquez ML, Bavota G, Bernal-Cárdenas C, Oliveto R, Penta MD, Poshyvanyk D (2014) Mining energy-greedy API usage patterns in android apps: an empirical study. In: Proceedings of the 11th working conference on mining software repositories (MSR)

  • Wang X, Li X, Wen W (2014) Wlcleaner: reducing energy waste caused by wakelock bugs at runtime. In: IEEE 12th international conference on dependable, autonomic and secure computing (DASC), 2014, pp 429–434

  • Woodside M, Franks G, Petriu DC (2007) The future of software performance engineering. In: Proceedings of the future of software engineering (FOSE) track, international conference on software engineering (ICSE)

  • Xu W, Huang L, Fox A, Patterson D, Jordan M (2009) Online system problem detection by mining patterns of console logs. In: Proceedings of the ninth IEEE international conference on data mining (ICDM)

  • Xu W, Huang L, Fox A, Patterson D, Jordan MI (2009) Detecting large-scale system problems by mining console logs. In: Proceedings of the ACM SIGOPS 22nd symposium on operating systems principles (SOSP)

  • Yuan D, Mai H, Xiong W, Tan L, Zhou Y, Pasupathy S (2010) Sherlog: error diagnosis by connecting clues from run-time logs. In: Proceedings of the fifteenth edition of ASPLOS on architectural support for programming languages and operating systems (ASPLOS)

  • Yuan D, Park S, Zhou Y (2012) Characterising logging practices in open-source software. In: Proceedings of the 34th international conference on software engineering (ICSE)

  • Yuan D, Zheng J, Park S, Zhou Y, Savage S (2011) Improving software diagnosability via log enhancement. In: Proceedings of the sixteenth international conference on architectural support for programming languages and operating systems (ASPLOS)

  • Zhang L, Tiwana B, Qian Z, Wang Z, Dick RP, Mao ZM, Yang L (2010) Accurate online power estimation and automatic battery behavior based power model generation for smartphones. In: Proceedings of the 8th IEEE/ACM/IFIP international conference on hardware/software codesign and system synthesis

Download references

Acknowledgments

Shaiful Chowdhury is grateful to the Alberta Innovates - Technology Futures (AITF) to support his PhD research. Both Abram Hindle and Zhen Ming (Jack) Jiang are supported by an NSERC Discovery Grant.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Shaiful Chowdhury.

Additional information

Communicated by: Maurizio Morisio

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Chowdhury, S., Di Nardo, S., Hindle, A. et al. An exploratory study on assessing the energy impact of logging on Android applications. Empir Software Eng 23, 1422–1456 (2018). https://doi.org/10.1007/s10664-017-9545-x

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10664-017-9545-x

Keywords

Navigation