skip to main content
tutorial
Public Access

One Process to Reap Them All: Garbage Collection as-a-Service

Published:08 April 2017Publication History
Skip Abstract Section

Abstract

Ubiquitous mobile platforms such as Android rely on managed language run-time environments, also known as language virtual machines (VMs), to run a diverse range of user applications (apps). Each app runs in its own private VM instance, and each VM makes its own private local decisions in managing its use of processor and memory resources. Moreover, the operating system and the hardware do not communicate their low-level decisions regarding power management with the high-level app environment. This lack of coordination across layers and across apps restricts more effective global use of resources on the device.

We address this problem by devising and implementing a global memory manager service for Android that optimizes memory usage, run-time performance, and power consumption globally across all apps running on the device. The service focuses on the impact of garbage collection (GC) along these dimensions, since GC poses a significant overhead within managed run-time environments. Our prototype collects system-wide statistics from all running VMs, makes centralized decisions about memory management across apps and across software layers, and also collects garbage centrally. Furthermore, the global memory manager coordinates with the power manager to tune collector scheduling. In our evaluation, we illustrate the impact of such a central memory management service in reducing total energy consumption (up to 18%) and increasing throughput (up to 12%), and improving memory utilization and adaptability to user activities.

References

  1. ACS714: Hall Effect-Based Linear Current Sensor. Allegro MicroSystems, LLC. URL http://www.pololu.com/product/1185.Google ScholarGoogle Scholar
  2. AndroidSVG. AndroidSVG --- SVG rendering library for Android, 2015. URL http://bigbadaboom.github.io/androidsvg.Google ScholarGoogle Scholar
  3. AppBrain Android market. AppTornado GmbH, 2016. URL http://www.appbrain.com/.Google ScholarGoogle Scholar
  4. AVG Android App performance report Q3. AVG. Now, 2015. URL http://now.avg.com/avg-android-app-performance-report-q3-2015/.Google ScholarGoogle Scholar
  5. N. Balasubramanian, A. Balasubramanian, and A. Venkataramani. Energy consumption in mobile phones: A measurement study and implications for network applications. In ACM SIGCOMM Conference on Internet Measurement Conference, IMC'09, pages 280--293, New York, NY, USA, 2009. ACM. ISBN 978-1-60558-771-4. doi: 10.1145/1644893.1644927. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. Bendersky and E. Petrank. Space overhead bounds for dynamic memory management with partial compaction. ACM Transactions on Programming Languages and Systems, 34(3):13:1--13:43, Nov. 2012. doi: 10.1145/2362389.2362392. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. S. M. Blackburn, P. Cheng, and K. S. McKinley. Myths and realities: The performance impact of garbage collection. In The Joint International Conference on Measurement and Modeling of Computer Systems, SIGMETRICS '04/Performance '04, pages 25--36, New York, NY, USA, 2004. ACM. ISBN 1-58113-873-3. doi: 10.1145/1005686.1005693. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. S. M. Blackburn, R. Garner, C. Hoffman, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. L. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo benchmarks: Java benchmarking development and analysis. In ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 169--190, Portland, Oregon, Oct. 2006. doi: 10.1145/1167473.1167488. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. S. Blagodurov, S. Zhuravlev, and A. Fedorova. Contention-aware scheduling on multicore systems. ACM Transactions on Computer Systems, 28(4):8:1--8:45, Dec. 2010. ISSN 0734-2071. doi: 10.1145/1880018.1880019. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. T. Brecht, E. Arjomandi, C. Li, and H. Pham. Controlling garbage collection and heap growth to reduce the execution time of java applications. ACM Transactions on Programming Languages and Systems, 28(5):908--941, Sept. 2006. doi: 10.1145/1152649.1152652. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. D. Brodowski. CPU frequency and voltage scaling code in the Linux kernel. URL https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt.Google ScholarGoogle Scholar
  12. N. Brouwers, M. Zuniga, and K. Langendoen. Neat: A novel energy analysis toolkit for free-roaming smartphones. In ACM Conference on Embedded Network Sensor Systems, SenSys'14, pages 16--30, New York, NY, USA, 2014. ACM. ISBN 978-1-4503-3143-2. doi: 10.1145/2668332.2668337. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. C. Cameron, J. Singer, and D. Vengerov. The judgment of Forseti: Economic utility for dynamic heap sizing of multiple runtimes. In ACM SIGPLAN International Symposium on Memory Management, pages 143--156, Portland, Oregon, June 2015. doi: 10.1145/2754169.2754180. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. T. Cao, S. M. Blackburn, T. Gao, and K. S. McKinley. The yin and yang of power and performance for asymmetric hardware and managed software. In International Symposium on Computer Architecture, pages 225--236, Portland, Oregon, June 2012. doi: 10.1109/ISCA.2012.6237020. Google ScholarGoogle ScholarCross RefCross Ref
  15. A. Carroll and G. Heiser. Unifying DVFS and offlining in mobile multicores. In IEEE Real-Time and Embedded Technology and Applications Symposium, pages 287--296, Berlin, Germany, Apr. 2014. doi: 10.1109/RTAS.2014.6926010. Google ScholarGoogle ScholarCross RefCross Ref
  16. G. Chen, M. T. Kandemir, N. Vijaykrishnan, M. J. Irwin, and M. Wolczko. Adaptive garbage collection for battery-operated environments. In USENIX Java Virtual Machine Research and Technology Symposium, pages 1--12, San Francisco, California, Aug. 2002. URL https://www.usenix.org/legacy/event/jvm02/chen_g.html.Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. G. Chen, R. Shetty, M. Kandemir, N. Vijaykrishnan, M. J. Irwin, and M. Wolczko. Tuning garbage collection for reducing memory system energy in an embedded Java environment. ACM Transactions on Embedded Computing Systems, 1(1):27--55, Nov. 2002. doi: 10.1145/581888.581892. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. X. Chen, A. Jindal, N. Ding, Y. C. Hu, M. Gupta, and R. Vannithamby. Smartphone background activities in the wild: Origin, energy drain, and optimization. In International Conference on Mobile Computing and Networking, MobiCom'15, pages 40--52, New York, NY, USA, 2015. ACM. ISBN 978-1-4503-3619-2. doi: 10.1145/2789168.2790107. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. C. J. Cheney. A nonrecursive list compacting algorithm. Commun. ACM, 13(11):677--678, Nov. 1970. doi: 10.1145/362790.362798. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. P. Cheng and G. E. Blelloch. A parallel, real-time garbage collector. In ACM SIGPLAN International Conference on Programming Language Design and Implementation, pages 125--136, Snowbird, Utah, June 2001. doi: 10.1145/378795.378823. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. G. Czajkowski and L. Daynés. Multitasking without compromise: A virtual machine evolution. In ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 125--138, Tampa, Florida, 2001. doi: 10.1145/504282.504292. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. F. M. David, J. C. Carlyle, and R. H. Campbell. Context switch overheads for Linux on ARM platforms. In Workshop on Experimental Computer Science, ExpCS'07, San Diego, California, 2007. doi: 10.1145/1281700.1281703. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. U. Degenbaev, J. Eisinger, M. Ernst, R. McIlroy, and H. Payer. Idle time garbage collection scheduling. In ACM SIGPLAN International Conference on Programming Language Design and Implementation, pages 570--583, San Jose, California, 2016. ISBN 978-1-4503-4261-2. doi: 10.1145/2908080.2908106. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. R. Efron. Conservation of temporal information by perceptual systems. Perception & Psychophysics, 14(3): 518--530, Oct. 1973. doi: 10.3758/BF03211193. Google ScholarGoogle ScholarCross RefCross Ref
  25. Taming the OOM killer. Eklektix, Inc., 2009. URL http://lwn.net/Articles/317814/.Google ScholarGoogle Scholar
  26. H. Franke and R. Russell. Fuss, futexes and furwocks: Fast userlevel locking in Linux. In Ottawa Linux Symposium, pages 479--495, Ottawa, Canada, June 2002. URL http://www.kernel.org/doc/ols/2002/ols2002-pages-479-495.pdf.Google ScholarGoogle Scholar
  27. AOSP issue tracker, 98332: Low memory killer is extremely aggressive. Google Inc., 2015. URL https://code.google.com/p/android/issues/detail?id=98332.Google ScholarGoogle Scholar
  28. Android ART and Dalvik. Google Inc., 2015. URL https://source.android.com/devices/tech/dalvik/art.html.Google ScholarGoogle Scholar
  29. monkeyrunner API. Google Inc., 2015. URL http://developer.android.com/tools/help/monkeyrunner_concepts.html.Google ScholarGoogle Scholar
  30. Android Processes and Threads. Google Inc., 2016. URL https://developer.android.com/guide/components/processes-and-threads.html.Google ScholarGoogle Scholar
  31. Android Open Source Project. Google Inc., 2016. URL http://source.android.com.Google ScholarGoogle Scholar
  32. P. Griffin, W. Srisa-an, and J. M. Chang. An energy efficient garbage collector for Java embedded devices. In ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools for Embedded Systems, pages 230--238, Chicago, Illinois, June 2005. doi: 10.1145/1065910.1065943. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. X. Guan, W. Srisa-an, and C. Jia. Investigating the effects of using different nursery sizing policies on performance. In ACM SIGPLAN International Symposium on Memory Management, ISMM'09, pages 59--68, New York, NY, USA, 2009. ACM. ISBN 978-1-60558-347-1. doi: 10.1145/1542431.1542441. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. A. Hussein, A. L. Hosking, M. Payer, and C. A. Vick. Don't race the memory bus: Taming the GC leadfoot. In ACM SIGPLAN International Symposium on Memory Management, pages 15--27, Portland, Oregon, 2015. doi: 10.1145/2754169.2754182. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. A. Iyer and D. Marculescu. Power efficiency of voltage scaling in multiple clock, multiple voltage cores. In IEEE/ACM International Conference on Computer-Aided Design, pages 379--386, San Jose, California, Nov. 2002. doi: 10.1145/774572.774629. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. N. Jacek, M.-C. Chiu, B. Marlin, and E. Moss. Assessing the limits of program-specific garbage collection performance. In ACM SIGPLAN International Conference on Programming Language Design and Implementation, pages 584--598, Santa Barbara, California, June 2016. doi: 10.1145/2908080.2908120. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. M. R. Jantz, F. J. Robinson, P. A. Kulkarni, and K. A. Doshi. Cross-layer memory management for managed language applications. In ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 488--504, Pittsburgh, Pennsylvania, Oct. 2015. doi: 10.1145/2814270.2814322. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. JSR 121: Application Isolation API Specification. Java Community Process. URL https://jcp.org/en/jsr/detail?id=121.Google ScholarGoogle Scholar
  39. R. Jones, A. Hosking, and E. Moss. The Garbage Collection Handbook: The Art of Automatic Memory Management. Chapman & Hall/CRC Press, 2011. Google ScholarGoogle ScholarCross RefCross Ref
  40. M. Kambadur and M. A. Kim. An experimental survey of energy management across the stack. In ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 329--344, Portland, Oregon, Oct. 2014. doi: 10.1145/2660193.2660196. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. S.-H. Kim, S. Kwon, J.-S. Kim, and J. Jeong. Controlling physical memory fragmentation in mobile systems. In ACM SIGPLAN International Symposium on Memory Management, pages 1--14, Portland, Oregon, June 2015. doi: 10.1145/2754169.2754179. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. P. Lengauer and H. Mössenböck. The taming of the shrew: Increasing performance by automatic parameter tuning for Java garbage collectors. In ACM/SPEC International Conference on Performance Engineering, pages 111--122, Dublin, Ireland, 2014. ISBN 978-1-4503-2733-6. doi: 10.1145/2568088.2568091. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. C. Li, C. Ding, and K. Shen. Quantifying the cost of context switch. In Workshop on Experimental Computer Science, ExpCS'07, San Diego, California, 2007. doi: 10.1145/1281700.1281702. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. H. Lieberman and C. E. Hewitt. A real-time garbage collector based on the lifetimes of objects. Commun. ACM, 26(6):419--429, June 1983. doi: 10.1145/358141.358147. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. M. Maas, K. Asanović, T. Harris, and J. Kubiatowicz. Taurus: A holistic language runtime system for coordinating distributed managed-language applications. In ACM International Conference on Architectural Support for Programming Languages and Operating Systems, pages 457--471, Atlanta, Georgia, Apr. 2016. doi: 10.1145/2872362.2872386. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. A. Miyoshi, C. Lefurgy, E. Van Hensbergen, R. Rajamony, and R. Rajkumar. Critical power slope: Understanding the runtime effects of frequency scaling. In International Conference on Supercomputing, pages 35--44, New York, New York, June 2002. doi: 10.1145/514191.514200. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Monsoon Power Monitors. Monsoon Solutions Inc., 2016. URL https://www.msoon.com/LabEquipment/PowerMonitor/.Google ScholarGoogle Scholar
  48. NI. NI USB-6008/6009 user guide and specifications, Feb. 2012. URL http://www.ni.com/pdf/manuals/371303m.pdf.Google ScholarGoogle Scholar
  49. A. Pathak, Y. C. Hu, M. Zhang, P. Bahl, and Y.-M. Wang. Fine-grained power modeling for smartphones using system call tracing. In ACM European Conference on Computer Systems, pages 153--168, Salzburg, Austria, Apr. 2011. doi: 10.1145/1966445.1966460. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. A. Pathak, Y. C. Hu, and M. Zhang. Where is the energy spent inside my app?: Fine grained energy accounting on smartphones with eprof. In ACM European Conference on Computer Systems, pages 29--42, Bern, Switzerland, Apr. 2012. doi: 10.1145/2168836.2168841. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. T. Printezis. On measuring garbage collection responsiveness. Science of Computer Programming, 62(2): 164--183, Oct. 2006. doi: 10.1016/j.scico.2006.02.004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. J. M. Robson. Worst case fragmentation of first fit and best fit storage allocation strategies. The Computer Journal, 20 (3):242--244, Aug. 1977. Google ScholarGoogle ScholarCross RefCross Ref
  53. J. B. Sartor and L. Eeckhout. Exploring multi-threaded Java application performance on multicore hardware. In ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 281--296, Tucson, Arizona, Oct. 2012. doi: 10.1145/2384616.2384638. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. A. Schulman, T. Schmid, P. Dutta, and N. Spring. Demo: Phone Power Monitoring with Battor, 2011. URL http://www.cs.umd.edu/~schulman/battor.html.Google ScholarGoogle Scholar
  55. J. Singer, G. Brown, I. Watson, and J. Cavazos. Intelligent selection of application-specific garbage collectors. In ACM SIGPLAN International Symposium on Memory Management, pages 91--102, Montréal, Canada, Oct. 2007. doi: 10.1145/1296907.1296920. Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. D. M. Ungar. Generation scavenging: A non-disruptive high performance storage reclamation algorithm. In ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments, pages 157--167, Pittsburgh, Pennsylvania, Apr. 1984. doi: 10.1145/800020.808261. Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. D. R. White, J. Singer, J. M. Aitken, and R. E. Jones. Control theory for principled heap sizing. In ACM SIGPLAN International Symposium on Memory Management, pages 27--38, Seattle, Washington, June 2013. doi: 10.1145/2464157.2466481.Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. R. Wilhelm, J. Engblom, A. Ermedahl, N. Holsti, S. Thesing, D. Whalley, G. Bernat, C. Ferdinand, R. Heckmann, T. Mitra, F. Mueller, I. Puaut, P. Puschner, J. Staschulat, and P. Stenström. The worst-case execution-time problem --- overview of methods and survey of tools. ACM Transactions on Embedded Computing Systems, 7(3):36:1--36:53, May 2008. doi: 10.1145/1347375.1347389. Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. F. Xian, W. Srisa-an, and H. Jiang. Contention-aware scheduler: Unlocking execution parallelism in multithreaded Java programs. In ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA'08, pages 163--180, New York, NY, USA, 2008. ACM. ISBN 978-1-60558-215-3. doi: 10.1145/1449764.1449778. Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. Y. Yan, C. Chen, K. Dantu, S. Y. Ko, and L. Ziarek. Using a multi-tasking VM for mobile applications. In International Workshop on Mobile Computing Systems and Applications, HotMobile'16, pages 93--98, St. Augustine, Florida, Feb. 2016. doi: 10.1145/2873587.2873596. Google ScholarGoogle ScholarDigital LibraryDigital Library
  61. L. Zhang, B. Tiwana, Z. Qian, Z. Wang, R. P. Dick, Z. M. Mao, and L. Yang. Accurate online power estimation and automatic battery behavior based power model generation for smartphones. In IEEE/ACM/IFIP international Conference on Hardware/Software Codesign and System Synthesis, CODES/ISSS'10, pages 105--114, New York, NY, USA, 2010. ACM. ISBN 978-1-60558-905-3. doi: 10.1145/1878961.1878982. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. One Process to Reap Them All: Garbage Collection as-a-Service

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 52, Issue 7
          VEE '17
          July 2017
          256 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/3140607
          Issue’s Table of Contents
          • cover image ACM Conferences
            VEE '17: Proceedings of the 13th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments
            April 2017
            261 pages
            ISBN:9781450349482
            DOI:10.1145/3050748

          Copyright © 2017 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 8 April 2017

          Check for updates

          Qualifiers

          • tutorial
          • Research
          • Refereed limited

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!