With the rise of the usage of computers and mobile devices, and the higher price of electricity, energy management of software has become a necessity for sustainable software, devices and IT services. Energy consumption in IT is rising through the rise of web and distributed services, cloud computing, or mobile devices. Therefore, energy management approaches have been developed, ranging from optimizing software code, to adaptation strategies based on hardware resources utilization. However, these approaches do not use proper energy information for their adaptations rendering themselves limited and not energy-aware. They do not provide an energy feedback of software, and limited information is available on how and where energy is spend in software code. To address these shortcomings, we present, in this thesis, energy models, approaches and tools in order to accurately estimate the energy consumption of software at the application level, at the code level, and for inferring energy evolution models based on the method's own input parameters. We also propose Jalen and Jalen Unit, two energy frameworks for estimating how much energy each portion of a code consumes, and for inferring energy evolution models based on empirical benchmarking of software methods. By using software estimations and energy models, we are able to provide accurate energy information without the need of power meters or hardware energy investment. The energy information we provide also gives energy management approaches direct and accurate energy measurements for their adaptations and optimizations. Provided energy information also draws a model of energy consumption evolution of software based on the values of their input parameters. This gives developers knowledge on energy efficiency in software leading to choose some code over others based on their energy performance. The experimentations using the implementations of our energy models offer important information on how and where energy is spend in software. In particular, we provide empirical comparison of programming languages (PL), algorithms implementations, the cost of using a virtual machine in PL, compilers' options, and I/O primitives. They also allow the detection of energy hotspots in software, therefore focusing on the main spots where further lookups are needed for energy optimizations. Finally, we demonstrate how our benchmarking framework can detect energy evolution patterns based on input parameters strategies. With our contributions, we aim to advance knowledge in energy consumption in software by proposing models, approaches and tools to accurately measure energy at finer grains. In a nutshell, we build a software-centric energy microscope and conduct experiments aimed to understand how energy is being consumed in software, and directions to be taken for energy optimized software.
Towards a Better Understanding of the Energy Consumption of Software Systems