skip to main content
research-article
Public Access

Prioritized garbage collection: explicit GC support for software caches

Published:19 October 2016Publication History
Skip Abstract Section

Abstract

Programmers routinely trade space for time to increase performance, often in the form of caching or memoization. In managed languages like Java or JavaScript, however, this space-time tradeoff is complex. Using more space translates into higher garbage collection costs, especially at the limit of available memory. Existing runtime systems provide limited support for space-sensitive algorithms, forcing programmers into difficult and often brittle choices about provisioning.

This paper presents prioritized garbage collection, a cooperative programming language and runtime solution to this problem. Prioritized GC provides an interface similar to soft references, called priority references, which identify objects that the collector can reclaim eagerly if necessary. The key difference is an API for defining the policy that governs when priority references are cleared and in what order. Application code specifies a priority value for each reference and a target memory bound. The collector reclaims references, lowest priority first, until the total memory footprint of the cache fits within the bound. We use this API to implement a space-aware least-recently-used (LRU) cache, called a Sache, that is a drop-in replacement for existing caches, such as Google's Guava library. The garbage collector automatically grows and shrinks the Sache in response to available memory and workload with minimal provisioning information from the programmer. Using a Sache, it is almost impossible for an application to experience a memory leak, memory pressure, or an out-of-memory crash caused by software caching.

References

  1. Edward E. Aftandilian and Samuel Z. Guyer. GC assertions: Using the garbage collector to check heap properties. In Proceedings of the 2009 ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 235–244. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Berk Atikoglu, Yuehai Xu, Eitan Frachtenberg, Song Jiang, and Mike Paleczny. Workload analysis of a large-scale keyvalue store. In Proceedings of the 12th ACM SIGMETRICS/PERFORMANCE Joint International Conference on Measurement and Modeling of Computer Systems, SIGMETRICS ’12, pages 53–64, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Jonathan Bellis. Jamm. https://github.com/jbellis/jamm.Google ScholarGoogle Scholar
  4. Stephen M. Blackburn, Perry Cheng, and Kathryn S. McKinley. Myths and realities: the performance impact of garbage collection. In Proceedings of the International Conference on Measurements and Modeling of Computer Systems, pages 25– 36, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Pei Cao and Sandy Irani. Cost-aware www proxy caching algorithms. In Proceedings of the USENIX Symposium on Internet Technologies and Systems on USENIX Symposium on Internet Technologies and Systems, pages 18–18, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Nachshon Cohen and Erez Petrank. Data structure aware garbage collector. In Proceedings of the 2015 ACM SIGPLAN International Symposium on Memory Management, ISMM 2015, pages 28–40, New York, NY, USA, 2015. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Carlos Cunha, Azer Bestavros, and Mark Crovella. Characteristics of WWW client-based traces. Technical Report BUCS-95-010, Computer Science Department, Boston University, Boston, MA, USA, 1995. Google ScholarGoogle Scholar
  8. Grzegorz Czajkowski and Thorsten von Eicken. JRes: A resource accounting interface for Java. In Proceedings of the 13th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications, OOPSLA ’98, pages 21–35, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Barry Hayes. Ephemerons: A new finalization mechanism. SIGPLAN Not., 32(10):176–183, October 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Matthew Hertz and Emery D. Berger. Quantifying the performance of garbage collection vs. explicit memory management. In OOPSLA ’05: Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming, systems, languages, and applications, pages 313–326, New York, NY, USA, 2005. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Google Inc. SoftReference — Android Developers, 2016 (Accessed March 23, 2016).Google ScholarGoogle Scholar
  12. Jikes RVM. IBM, 2005. http://jikesrvm.sourceforge.net.Google ScholarGoogle Scholar
  13. Mark S. Johnstone and Paul R. Wilson. The memory fragmentation problem: Solved? In Proceedings of the 1st International Symposium on Memory Management, pages 26–36, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Nick Mitchell and Gary Sevitsky. Leakbot: An automated and lightweight tool for diagnosing memory leaks in large Java applications. In ECOOP 2003 - Object-Oriented Programming, 17th European Conference, Darmstadt, Germany, July 21-25, 2003, Proceedings, pages 351–377, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  15. M. E. J. Newman. Power laws, Pareto distributions and Zipf’s law. Contemporary Physics, 2005.Google ScholarGoogle Scholar
  16. Melissa E. O’Neill and F. Warren Burton. Smarter garbage collection with simplifiers. In Proceedings of the 2006 Workshop on Memory System Performance and Correctness, MSPC ’06, pages 19–30, New York, NY, USA, 2006. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Oracle. SoftReference (Java Platform SE 6), 2015.Google ScholarGoogle Scholar
  18. David W. Price, Algis Rudys, and Dan S. Wallach. Garbage collector memory accounting in language-based systems. In Proceedings of the 2003 IEEE Symposium on Security and Privacy, SP ’03, pages 263–, Washington, DC, USA, 2003. IEEE Computer Society. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Paul R. Wilson, Mark S. Johnstone, Michael Neely, and David Boles. Dynamic storage allocation: A survey and critical review. In International Workshop on Memory Management, pages 1–116, September 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Guoqing Xu, Michael D. Bond, Feng Qin, and Atanas Rountev. LeakChaser: Helping programmers narrow down causes of memory leaks. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’11, pages 270–282, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Edward Z. Yang and David Mazières. Dynamic space limits for Haskell. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’14, pages 588–598, New York, NY, USA, 2014. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Prioritized garbage collection: explicit GC support for software caches

    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 51, Issue 10
      OOPSLA '16
      October 2016
      915 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/3022671
      Issue’s Table of Contents
      • cover image ACM Conferences
        OOPSLA 2016: Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications
        October 2016
        915 pages
        ISBN:9781450344449
        DOI:10.1145/2983990

      Copyright © 2016 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 19 October 2016

      Check for updates

      Qualifiers

      • research-article

    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!