Effective memory management for mobile environments

Hussein, Ahmed Mohamed Abd-elhaffiez PhD, Purdue University, December 2016. Effective Memory Managementfor Mobile Environments. Major Professors: Antony L. Hosking and Mathias Payer. Smartphones, tablets, and other mobile devices exhibit vastly different constraints compared to regular or classic computing environments like desktops, laptops, or servers. Mobile devices run dozens of so-called “apps” hosted by independent virtual machines (VM). All these VMs run concurrently and each VM deploys purely local heuristics to organize resources like memory, performance, and power. Such a design causes conflicts across all layers of the software stack, calling for the evaluation of VMs and the optimization techniques specific for mobile frameworks. In this dissertation, we study the design of managed runtime systems for mobile platforms. More specifically, we deepen the understanding of interactions between garbage collection (GC) and system layers. We develop tools to monitor the memory behavior of Android-based apps and to characterize GC performance, leading to the development of new techniques for memory management that address energy constraints, time performance, and responsiveness. We implement a GC-aware frequency scaling governor for Android devices. We also explore the tradeoffs of power and performance in vivo for a range of realistic GC variants, with established benchmarks and real applications running on Android virtual machines. We control for variation due to dynamic voltage and frequency scaling (DVFS), Just-in-time (JIT) compilation, and across established dimensions of heap memory size and concurrency. Finally, we provision GC as a global service that collects statistics from all running VMs and then makes an informed decision that optimizes across all them (and not just locally), and across all layers of the stack.

[1]  Xiaoxiao Ma,et al.  Predicting mobile application usage using contextual information , 2012, UbiComp.

[2]  Mahmut T. Kandemir,et al.  Energy Behavior of Java Applications from the Memory Perspective , 2001, Java Virtual Machine Research and Technology Symposium.

[3]  Deborah Estrin,et al.  Diversity in smartphone usage , 2010, MobiSys '10.

[4]  Mahmut T. Kandemir,et al.  Tuning garbage collection for reducing memory system energy in an embedded java environment , 2002, TECS.

[5]  Karim Yaghmour Embedded Android: Porting, Extending, and Customizing , 2013 .

[6]  Mathias Payer,et al.  One Process to Reap Them All: Garbage Collection as-a-Service , 2017, VEE.

[7]  Prasad A. Kulkarni,et al.  Cross-layer memory management for managed language applications , 2015, OOPSLA.

[8]  Ming Zhang,et al.  Where is the energy spent inside my app?: fine grained energy accounting on smartphones with Eprof , 2012, EuroSys '12.

[9]  Tajana Simunic,et al.  Context-Aware Mobile Power Management Using Fuzzy Inference as a Service , 2012, MobiCASE.

[10]  Jin-Soo Kim,et al.  Controlling physical memory fragmentation in mobile systems , 2015, ISMM.

[11]  John Michael Robson,et al.  Worst Case Fragmentation of First Fit and Best Fit Storage Allocation Strategies , 1977, Comput. J..

[12]  Daniel Gatica-Perez,et al.  Where and what: Using smartphones to predict next locations and applications in daily life , 2014, Pervasive Mob. Comput..

[13]  Grzegorz Czajkowski,et al.  Multitasking without compromise: a virtual machine evolution , 2001, SIGP.

[14]  Kaigui Bian,et al.  Characterizing Smartphone Usage Patterns from Millions of Android Users , 2015, Internet Measurement Conference.

[15]  Richard E. Jones,et al.  The Garbage Collection Handbook: The art of automatic memory management , 2011, Chapman and Hall / CRC Applied Algorithms and Data Structures Series.

[16]  Chris J. Cheney A nonrecursive list compacting algorithm , 1970, Commun. ACM.

[17]  Karthik Dantu,et al.  Using a Multi-Tasking VM for Mobile Applications , 2016, HotMobile.

[18]  Peter Martini,et al.  Automatic estimation of performance requirements for software tasks of mobile devices , 2011, ICPE '11.

[19]  Brad Calder,et al.  Discovering and Exploiting Program Phases , 2003, IEEE Micro.

[20]  Tony Printezis,et al.  On measuring garbage collection responsiveness , 2006, Sci. Comput. Program..

[21]  Lieven Eeckhout,et al.  Exploring multi-threaded Java application performance on multicore hardware , 2012, OOPSLA '12.

[22]  Alan L. Cox,et al.  Characterization of Shared Library Access Patterns of Android Applications , 2015, 2015 IEEE International Symposium on Workload Characterization.

[23]  Dam Sunwoo,et al.  A structured approach to the simulation, analysis and characterization of smartphone applications , 2013, 2013 IEEE International Symposium on Workload Characterization (IISWC).

[24]  David R. White,et al.  Control theory for principled heap sizing , 2013, ISMM '13.

[25]  Trevor Mudge,et al.  MiBench: A free, commercially representative embedded benchmark suite , 2001 .

[26]  Amer Diwan,et al.  Wake up and smell the coffee: evaluation methodology for the 21st century , 2008, CACM.

[27]  Henry Lieberman,et al.  A real-time garbage collector based on the lifetimes of objects , 1983, CACM.

[28]  Ana R. Cavalli,et al.  Detecting Control Flow in Smarphones: Combining Static and Dynamic Analyses , 2012, CSS.

[29]  Jeremy Singer,et al.  The judgment of forseti: economic utility for dynamic heap sizing of multiple runtimes , 2015, ISMM.

[30]  Hanspeter Mössenböck,et al.  The taming of the shrew: increasing performance by automatic parameter tuning for java garbage collectors , 2014, ICPE.

[31]  Yan Wang,et al.  Static Control-Flow Analysis of User-Driven Callbacks in Android Applications , 2015, 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.

[33]  Roy H. Campbell,et al.  Context switch overheads for Linux on ARM platforms , 2007, ExpCS '07.

[34]  Shirley Moore,et al.  Non-determinism and overcount on modern hardware performance counter implementations , 2013, 2013 IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS).

[35]  Laurie Hendren,et al.  Dynamic metrics for java , 2003, OOPSLA 2003.

[36]  Gernot Heiser,et al.  Mobile multicores: use them or waste them , 2014, ACM SIGOPS Oper. Syst. Rev..

[37]  Ye Xu,et al.  Preference, context and communities: a multi-faceted approach to predicting smartphone app usage patterns , 2013, ISWC '13.

[38]  Shankar Balachandran,et al.  The Implications of Shared Data Synchronization Techniques on Multi-Core Energy Efficiency , 2012, HotPower.

[39]  Xi Yang,et al.  Looking back on the language and hardware revolutions: measured power, performance, and scaling , 2011, ASPLOS XVI.

[40]  Ramesh Govindan,et al.  Estimating mobile application energy consumption using program analysis , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[41]  Meng-Chieh Chiu,et al.  Assessing the limits of program-specific garbage collection performance , 2016, PLDI.

[42]  John Kubiatowicz,et al.  GPUs as an opportunity for offloading garbage collection , 2012, ISMM '12.

[43]  Leslie Lamport,et al.  On-the-fly garbage collection: an exercise in cooperation , 1975, Language Hierarchies and Interfaces.

[44]  Marco Pistoia,et al.  Dynamic detection of inter-application communication vulnerabilities in Android , 2015, ISSTA.

[45]  Tim Brecht,et al.  Controlling garbage collection and heap growth to reduce the execution time of Java applications , 2006, TOPL.

[46]  James Won-Ki Hong,et al.  Usage pattern analysis of smartphones , 2011, 2011 13th Asia-Pacific Network Operations and Management Symposium.

[47]  Ting Cao,et al.  The Yin and Yang of power and performance for asymmetric hardware and managed software , 2012, 2012 39th Annual International Symposium on Computer Architecture (ISCA).

[48]  Yuanyuan Zhou,et al.  Managing energy-performance tradeoffs for multithreaded applications on multiprocessor architectures , 2007, SIGMETRICS '07.

[49]  Gernot Heiser,et al.  Unifying DVFS and offlining in mobile multicores , 2014, 2014 IEEE 19th Real-Time and Embedded Technology and Applications Symposium (RTAS).

[50]  Mathias Payer,et al.  Don't race the memory bus: taming the GC leadfoot , 2015, ISMM.

[51]  Urs Hölzle,et al.  A Study of the Allocation Behavior of the SPECjvm98 Java Benchmark , 1999, ECOOP.

[52]  Mahmut T. Kandemir,et al.  Adaptive Garbage Collection for Battery-Operated Environments , 2002, Java Virtual Machine Research and Technology Symposium.

[53]  C. Moorehead All rights reserved , 1997 .

[54]  Jakob Engblom,et al.  The worst-case execution-time problem—overview of methods and survey of tools , 2008, TECS.

[55]  Ragunathan Rajkumar,et al.  Critical power slope: understanding the runtime effects of frequency scaling , 2002, ICS '02.

[56]  Dan S. Wallach,et al.  Longitudinal Analysis of Android Ad Library Permissions , 2013, ArXiv.

[57]  R. Efron,et al.  Conservation of temporal information by perceptual systems , 1973 .

[58]  David A. Wagner,et al.  Analyzing inter-application communication in Android , 2011, MobiSys '11.

[59]  Melanie Kambadur,et al.  An experimental survey of energy management across the stack , 2014, OOPSLA.

[60]  Jin-Hyuk Hong,et al.  Understanding and prediction of mobile application usage for smart phones , 2012, UbiComp.

[61]  Christopher Krügel,et al.  EdgeMiner: Automatically Detecting Implicit Control Flow Transitions through the Android Framework , 2015, NDSS.

[62]  Jacques Klein,et al.  FlowDroid: precise context, flow, field, object-sensitive and lifecycle-aware taint analysis for Android apps , 2014, PLDI.

[63]  David M. Ungar,et al.  Generation Scavenging: A non-disruptive high performance storage reclamation algorithm , 1984, SDE 1.

[64]  Ratul Mahajan,et al.  AppInsight: Mobile App Performance Monitoring in the Wild , 2022 .

[65]  Mathias Payer,et al.  Impact of GC design on power and performance for Android , 2015, SYSTOR.

[66]  Lixin Zhang,et al.  Moby: A mobile benchmark suite for architectural simulators , 2014, 2014 IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS).

[67]  Ronald G. Dreslinski,et al.  Full-system analysis and characterization of interactive smartphone applications , 2011, 2011 IEEE International Symposium on Workload Characterization (IISWC).

[68]  Alain Girault,et al.  Tradeoff exploration between reliability, power consumption, and execution time for embedded systems , 2011, International Journal on Software Tools for Technology Transfer.

[69]  Prasant Mohapatra,et al.  Predicting user traits from a snapshot of apps installed on a smartphone , 2014, MOCO.

[70]  Erez Petrank,et al.  Space overhead bounds for dynamic memory management with partial compaction , 2011, POPL '11.

[71]  Christian Bonnet,et al.  Usage patterns based security attacks for smart devices , 2014, 2014 IEEE Fourth International Conference on Consumer Electronics Berlin (ICCE-Berlin).

[72]  Gavin Brown,et al.  Intelligent selection of application-specific garbage collectors , 2007, ISMM '07.

[73]  Gabriele Bavota,et al.  Mining energy-greedy API usage patterns in Android apps: an empirical study , 2014, MSR 2014.

[74]  David F. Bacon,et al.  Parallel real-time garbage collection of multiple heaps in reconfigurable hardware , 2014, ISMM '14.

[75]  Dawn Xiaodong Song,et al.  Understanding Mobile App Usage Patterns Using In-App Advertisements , 2013, PAM.

[76]  Diana Marculescu,et al.  Power efficiency of voltage scaling in multiple clock, multiple voltage cores , 2002, ICCAD 2002.

[77]  Chen Ding,et al.  Quantifying the cost of context switch , 2007, ExpCS '07.

[78]  Bo Yan,et al.  Nihao: A Predictive Smartphone Application Launcher , 2012, MobiCASE.

[79]  Erez Petrank,et al.  Implementing an on-the-fly garbage collector for Java , 2000, ISMM '00.

[80]  Eric Rotenberg,et al.  Virtual simple architecture (VISA): exceeding the complexity limit in safe real-time systems , 2003, ISCA '03.

[81]  Paramvir Bahl,et al.  Fine-grained power modeling for smartphones using system call tracing , 2011, EuroSys '11.

[82]  Dimitrios Koutsonikolas,et al.  Characterizing mobile user habits: The case for energy budgeting , 2015, 2015 IEEE Conference on Computer Communications Workshops (INFOCOM WKSHPS).

[83]  Gustavo Pinto,et al.  Understanding energy behaviors of thread management constructs , 2014, OOPSLA 2014.

[84]  Tomas Kalibera,et al.  Rigorous benchmarking in reasonable time , 2013, ISMM '13.

[85]  Jan Vitek,et al.  A black-box approach to understanding concurrency in DaCapo , 2012, OOPSLA '12.

[86]  Guy E. Blelloch,et al.  A parallel, real-time garbage collector , 2001, PLDI '01.

[87]  Adam Doupé,et al.  Checking Intent-based Communication in Android with Intent Space Analysis , 2016, AsiaCCS.

[88]  John Kubiatowicz,et al.  Taurus: A Holistic Language Runtime System for Coordinating Distributed Managed-Language Applications , 2016, ASPLOS.

[89]  T. J. Watson,et al.  Fuss , Futexes and Furwocks : Fast Userlevel Locking in Linux Hubertus Franke IBM , 2005 .

[90]  Angelos Stavrou,et al.  Behavioral Analysis of Android Applications Using Automated Instrumentation , 2013, 2013 IEEE Seventh International Conference on Software Security and Reliability Companion.

[91]  Saeed Moghaddam,et al.  MobileMiner: mining your frequent patterns on your phone , 2014, UbiComp.

[92]  Ramesh Govindan,et al.  SIF: a selective instrumentation framework for mobile applications , 2013, MobiSys '13.

[93]  Chao Yang,et al.  DroidMiner: Automated Mining and Characterization of Fine-grained Malicious Behaviors in Android Applications , 2014, ESORICS.

[94]  Witawas Srisa-an,et al.  An energy efficient garbage collector for java embedded devices , 2005, LCTES '05.