Improving Energy Consumption of Java Programs
Total Page:16
File Type:pdf, Size:1020Kb
Wayne State University Wayne State University Dissertations January 2019 Improving Energy Consumption Of Java Programs Mohit Kumar Wayne State University Follow this and additional works at: https://digitalcommons.wayne.edu/oa_dissertations Part of the Computer Sciences Commons Recommended Citation Kumar, Mohit, "Improving Energy Consumption Of Java Programs" (2019). Wayne State University Dissertations. 2325. https://digitalcommons.wayne.edu/oa_dissertations/2325 This Open Access Dissertation is brought to you for free and open access by DigitalCommons@WayneState. It has been accepted for inclusion in Wayne State University Dissertations by an authorized administrator of DigitalCommons@WayneState. IMPROVING ENERGY CONSUMPTION OF JAVA PROGRAMS by MOHIT KUMAR DISSERTATION Submitted to the Graduate School of Wayne State University, Detroit, Michigan in partial fulfillment of the requirements for the degree of DOCTOR OF PHILOSOPHY 2019 MAJOR: COMPUTER SCIENCE Approved by: Advisor Date ©COPYRIGHT BY Mohit Kumar 2019 All Rights Reserved ii DEDICATION This dissertation wouldn’t have been possible without the love, support, and care from my family. My mother (Usha Rani), who always nurture me with her positive thoughts. My father (Jagbir Singh), who always make sure that I had anything I needed. My sister (Sakshi), who always makes me laugh by reminiscing about happy memories. My wife (Namita), without whom I couldn’t have thought of starting it. iii ACKNOWLEDGMENTS My Ph.D. journey started in 2014 at Wayne State University. However, this journey became worthwhile when I joined MIST Lab in 2015. I would like to express my heartfelt thanks to Dr. Weisong Shi for accepting me as his Ph.D. student. His support and guidance helped me to work on various research projects. I also want to thanks my MIST lab mates who never hesitated to help me. In their presence, I never felt alone in the lab and able to connect with Chinese culture and food. I also want to thanks my committee members - Dr. Daniel Grosu, Dr. Nathan Fisher, and Dr. Devesh Tiwari. They provided various valuable suggestions that helped to enhance this disserta- tion. Moreover, I want to thanks the National Science Foundation (NSF) for supporting this work partly by grant CNS-1561216. Last but not least, I want to thanks my wife for always supporting, believing, and encouraging me. I am deeply grateful to her as she was always there when I need her. iv TABLE OF CONTENTS Dedication iii Acknowledgments iv List of Tables viii List of Figures x List of Codes xii 1 Introduction 1 1.1 Problem Statements & Plans . 2 1.1.1 Calculating idle energy . 2 1.1.2 Analyzing Java programs energy . 3 1.1.3 Analyzing Java command-line options energy . 5 1.1.4 Eclipse plugin for Java energy-saving suggestions . 5 1.1.5 Summary of contributions . 6 1.2 Outline . 7 2 Background 8 2.1 Energy & Power . 8 2.2 ICT systems classification . 10 2.2.1 Embedded Systems . 10 2.2.2 Handheld Devices . 10 2.2.3 Personal Computer . 11 2.2.4 Data Center . 11 2.2.5 Supercomputer . 12 2.3 ICT systems energy demand . 12 2.3.1 Thermal Design Power (TDP) . 13 2.3.2 Performance per Watt . 13 2.4 Hardware Performance Counters . 13 v 2.5 Benchmarks . 14 2.6 Software Role . 14 2.7 Power Measurement . 16 2.7.1 Hardware-Based methods . 16 2.7.2 Software-Based Methods . 16 2.7.3 Hybrid-Based Methods . 18 2.8 Summary . 18 3 Calculating Idle Energy 20 3.1 Set Up . 20 3.2 Idle Energy . 20 3.3 Stopping System Services . 21 3.4 Summary . 23 4 Energy Efficiency of Java Programs 25 4.1 Energy Consumption Traits . 25 4.1.1 Variables . 26 4.1.2 Operators . 31 4.1.3 Control Statements . 36 4.1.4 Exceptions . 41 4.1.5 String . 43 4.1.6 Objects . 47 4.1.7 Threads . 48 4.1.8 Arrays . 49 4.2 Energy And Execution Time . 51 4.3 Threats to Validity . 53 4.4 Related Work . 55 4.5 Summary . 58 vi 5 Energy Consumption Analysis of Java Command-line Options 59 5.1 Energy Consumption Analysis . 60 5.1.1 -client and -server ........................... 63 5.1.2 -Xbatch, -Xcomp, -Xint, -Xfuture, and -Xmixed . 65 5.1.3 -Xrs ..................................... 69 5.1.4 -XX:+AggressiveOpts and -XX:+AggressiveHeap . 70 5.1.5 -XX:-Inline ............................... 72 5.1.6 -XX:+AlwaysPreTouch ......................... 73 5.1.7 Garbage collection options . 74 5.2 Energy & Time . 77 5.3 Related Work . 78 5.4 Summary . 78 6 JEPO: Java Energy Profiler and Optimizer 80 6.1 JEPO . 80 6.2 Validation . 84 6.3 Related Work . 86 6.4 Summary . 87 7 Conclusion 88 8 Future Work 90 References 91 Abstract 103 Autobiographical statement 105 vii LIST OF TABLES 1.1 RAPL domains . 2 2.1 Energy Consumption Units . 9 2.2 ICT Systems TDP rating [1] . 12 2.3 Performance Counter in Processor Family . 13 3.1 System specification . 21 4.1 A summary of the observations . 55 5.1 SPECjvm2008 benchmarks . 61 5.2 Energy consumption for client option . 62 5.3 Energy consumption for server option . 63 5.4 Energy consumption for Xbatch option . 64 5.5 Energy consumption for Xcomp option . 65 5.6 Energy consumption for Xint option . 66 5.7 Energy consumption for Xfuture option . 67 5.8 Energy consumption for Xmixed option . 68 5.9 Energy consumption for Xrs option . 69 5.10 Energy consumption for AggressiveOpts option . 70 5.11 Energy consumption for AggressiveHeap option . 71 5.12 Energy consumption for Inline Disable option . 72 5.13 Energy consumption for AlwaysPreTouch option . 73 5.14 Energy consumption for Xnoclassgc option . 74 5.15 Energy consumption for UseSerialGC option . 75 5.16 Energy consumption for UseConcMarkSweepGC option . 76 5.17 Energy consumption for UseG1GC option . 77 6.1 Java Components & Suggestions . 81 6.2 WEKA classifiers metrics . 84 6.3 MOA airlines data . 85 viii 6.4 WEKA evaluation . 86 ix LIST OF FIGURES 1.1 Idle energy consumption of Ubuntu Desktop . 3 3.1 Intel Fog Node package idle energy consumption . 22 3.2 Laptop package idle energy consumption . 22 3.3 Intel Fog Node dataset . 22 3.4 Laptop dataset . 23 4.1 Primitive data types energy consumption . 26 4.2 Instance and static variables energy consumption . 28 4.3 Float and Double scientific notation energy consumption . 30 4.4 Arithmetic operators using long variables energy consumption . 33 4.5 Short-circuit operator energy consumption . 34 4.6 Increment and decrement operators energy consumption . 35 4.7 Conditional operator and if-then-else energy consumption . 36 4.8 Iteration variable energy consumption . 37 4.9 Termination expression variable.