skip to main content
10.1145/2070942.2070973acmconferencesArticle/Chapter ViewAbstractPublication PagessensysConference Proceedingsconference-collections
research-article

Offline GC: trashing reachable objects on tiny devices

Published:01 November 2011Publication History

ABSTRACT

The ability of tiny embedded devices to run large and feature-rich Java programs is typically constrained by the amount of memory installed on those devices. Furthermore, the useful operation of such devices in a wireless sensor application is limited by their battery life. We propose a garbage collection (GC) scheme called Offline GC which alleviates both these limitations. Our approach defies the current practice in which an object may be deallocated only if it is unreachable. Offline GC allows freeing an object that is still reachable but is guaranteed not to be used again in the program. Furthermore, it may deallocate an object inside a function, a loop or a block where it is last used, even if that object is assigned to a global field. This leads to a larger amount of memory available to a program.

Based on an inter-procedural and field-sensitive data flow analysis we identify, during program compilation, the point at which an object can safely be deallocated at runtime. We have designed three algorithms for the purpose of making these offline deallocation decisions. Our implementation of Offline GC indicates a significant reduction in the amount of RAM and the number of CPU cycles needed to run a variety of benchmark programs. Offline GC is shown to increase the average amount of RAM available to a program by up to 82% compared to a typical online garbage collector. Furthermore, the number of CPU cycles consumed in freeing the memory is reduced by up to 94% when Offline GC is used.

Skip Supplemental Material Section

Supplemental Material

systems_2.mp4

mp4

142.5 MB

References

  1. ETH Zurich. The Sensor Network Museum. http://www.snm.ethz.ch/Main/HomePage, {Last Accessed: 15.08.2011}.Google ScholarGoogle Scholar
  2. Niels Brouwers, Koen Langendoen, and Peter Corke. Darjeeling, a Feature-Rich VM for the Resource Poor. In Proceedings of the 7th ACM Conference on Embedded Networked Sensor Systems, SenSys '09, pages 169--182, New York, NY, USA, 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Faisal Aslam, Luminous Fennell, Christian Schindelhauer, Peter Thiemann, Gidon Ernst, Elmar Haussmann, Stefan Rührup, and Zastash Afzal Uzmi. Optimized Java Binary and Virtual Machine for Tiny Motes. In Distributed Computing in Sensor Systems (DCOSS), volume 6131, chapter 2, pages 15--30. Springer Berlin Heidelberg, Berlin, Heidelberg, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Janice J. Heiss. Sentilla's Pervasive Computing -- The Universe Is the Computer. 2008 JavaOne Conference.Google ScholarGoogle Scholar
  5. Richard Jones and Rafael Lins. Garbage Collection: Algorithms for Automatic Dynamic Memory Management. John Wiley & Sons, September 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Sigmund Cherem and Radu Rugina. Uniqueness Inference for Compile-Time Object Deallocation. In Proceedings of the 6th international symposium on Memory management, ISMM '07, pages 117--128, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Samuel Guyer, Kathryn McKinley, and Daniel Frampton. Free-Me: A Static Analysis for Automatic Individual Object Reclamation. In Proceedings of the 2006 ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI '06, pages 364--375, New York, NY, USA, 2006. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Elvira Albert, Samir Genaim, and Miguel Gomez-Zamalloa. Heap Space Analysis for Java Bytecode. In Proceedings of the 6th International Symposium on Memory Management, ISMM '07, pages 105--116, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Jong-Deok Choi, Manish Gupta, Mauricio Serrano, Vugranam C. Sreedhar, and Sam Midkiff. Escape Analysis for Java. In Proceedings of the 14th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA '99, pages 1--19, New York, NY, USA, 1999. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Bruno Blanchet. Escape Analysis for Java#8482;: Theory and Practice. ACM Transactions on Programming Languages and Systems (TOPLAS), 25:713--775, November 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Tim Lindholm and Frank Yellin. Java Virtual Machine Specification. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2nd edition, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Source code. GCBench and GCOld benchmarks. http://www.cs.cmu.edu/~spoons/gc/benchmarks.html, {Last Accessed: 15.08.2011}.Google ScholarGoogle Scholar
  13. Omprakash Gnawali, Rodrigo Fonseca, Kyle Jamieson, David Moss, and Philip Levis. Collection Tree Protocol. In Proceedings of the 7th ACM Conference on Embedded Networked Sensor Systems, SenSys '09, pages 1--14. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Ian Chakeres and Charles Perkins. Dynamic MANET On-demand (DYMO) Routing. IETF (work in progress), 2010.Google ScholarGoogle Scholar
  15. David Bacon, Perry Cheng, and David Grove. Garbage Collection for Embedded Systems. In Proceedings of the 4th ACM International Conference on Embedded Software, EM-SOFT '04, pages 125--136, New York, NY, USA, 2004. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Kumar Shiv, Kingsum Chow, Yanping Wang, and Dmitry Petrochenko. SPECjvm2008 Performance Characterization. In Proceedings of the 2009 SPEC Benchmark Workshop on Computer Performance Evaluation and Benchmarking, pages 17--35, Berlin, Heidelberg, 2009. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Daniel Spoonhower, Guy Blelloch, and Robert Harper. Using Page Residency to Balance Tradeoffs in Tracing Garbage Collection. In Proceedings of the 1st ACM/USENIX International Conference on Virtual Execution Environments, VEE '05, pages 57--67, New York, NY, USA, 2005. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Crossbow Technology. Wireless Sensor Networks. http://www.xbow.com, {Last Accessed: 15.02.2011}.Google ScholarGoogle Scholar
  19. Ben Lawrence Titzer, Daniel Lee, and Jens Palsberg. Avrora: Scalable Sensor Network Simulation with Precise Timing. In Proceedings of the 4th International Symposium on Information Processing in Sensor Networks, IPSN '05, Piscataway, NJ, USA, 2005. IEEE Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Luminous Fennell. Garbage Collection for TakaTuka, Bachelors Thesis. University of Freiburg, Germany, 2010.Google ScholarGoogle Scholar
  21. Jeffrey Barth. Shifting Garbage Collection Overhead to Compile Time. Communications of the ACM (CACM), 20:513--518, July 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Pramod Joisha. Overlooking Roots: A Framework for Making Nondeferred Reference-Counting Garbage Collection Fast. In Proceedings of the 6th International Symposium on Memory Management, ISMM '07, pages 141--158, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Wolfram Schulte. Deriving Residual Reference Count Garbage Collectors. In Symposium on Programming Language Implementation and Logic Programming (PLILP), pages 102--116. Springer-Verlag, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Ran Shaham, Eran Yahav, Elliot Kolodner, and Mooly Sagiv. Establishing Local Temporal Heap Safety Properties with Applications to Compile-Time Memory Management. In Static Analysis, volume 2694 of Lecture Notes in Computer Science, pages 483--503. Springer Berlin/Heidelberg, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Ole Agesen, David Detlefs, and J. Eliot Moss. Garbage collection and local variable type-precision and liveness in Java virtual machines. In Proceedings of the ACM SIGPLAN 1998 Conference on Programming Language Design and Implementation, PLDI '98, pages 269--279, New York, NY, USA, 1998. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Sigmund Cherem and Radu Rugina. Compile-Time Deallocation of Individual Objects. In Proceedings of the 5th International Symposium on Memory Management, ISMM '06, pages 138--149, New York, NY, USA, 2006. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Dan Grossman, Greg Morrisett, Trevor Jim, Michael Hicks, Yanling Wang, and James Cheney. Region-Based Memory Management in Cyclone. In Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design and Implementation, PLDI '02, pages 282--293, New York, NY, USA, 2002. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Neil Jones and Steven Muchnick. Flow Analysis and Optimization of LISP-like Structures. In Proceedings of the 6th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, POPL '79, pages 244--256, New York, NY, USA, 1979. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Alexandru Stefan, Florin Craciun, and Wei-Ngan Chin. A Flow-Sensitive Region Inference for CLI. In Proceedings of the 6th Asian Symposium on Programming Languages and Systems, APLAS '08, pages 19--35, Berlin, Heidelberg, 2008. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Sigmund Cherem and Radu Rugina. Region Analysis and Transformation for Java Programs. In Proceedings of the 4th International Symposium on Memory Management, ISMM '04, pages 85--96, New York, NY, USA, 2004. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. David Gay and Alex Aiken. Memory Management with Explicit Regions. In Proceedings of the ACM SIGPLAN 1998 Conference on Programming Language Design and Implementation, PLDI '98, pages 313--323, New York, NY, USA, 1998. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Offline GC: trashing reachable objects on tiny devices

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
  • Published in

    cover image ACM Conferences
    SenSys '11: Proceedings of the 9th ACM Conference on Embedded Networked Sensor Systems
    November 2011
    452 pages
    ISBN:9781450307185
    DOI:10.1145/2070942

    Copyright © 2011 ACM

    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 1 November 2011

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • research-article

    Acceptance Rates

    Overall Acceptance Rate174of867submissions,20%

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader