Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2926697.2926698acmconferencesArticle/Chapter ViewAbstractPublication PagesismmConference Proceedingsconference-collections
research-article

Liveness-based garbage collection for lazy languages

Published: 14 June 2016 Publication History
  • Get Citation Alerts
  • Abstract

    We consider the problem of reducing the memory required to run lazy first-order functional programs. Our approach is to analyze programs for liveness of heap-allocated data. The result of the analysis is used to preserve only live data—a subset of reachable data—during garbage collection. The result is an increase in the garbage reclaimed and a reduction in the peak memory requirement of programs. Whereas this technique has already been shown to yield benefits for eager first-order languages, the lack of a statically determinable execution order and the presence of closures pose new challenges for lazy languages. These require changes both in the liveness analysis itself and in the design of the garbage collector. To show the effectiveness of our method, we implemented a copying collector that uses the results of the liveness analysis to preserve live objects, both evaluated and closures. Our experiments confirm that for programs running with a liveness-based garbage collector, there is a significant decrease in peak memory requirements. In addition, a sizable reduction in the number of collections ensures that in spite of using a more complex garbage collector, the execution times of programs running with liveness and reachability-based collectors remain comparable.

    References

    [1]
    An artificial garbage collection benchmark. http://www. hboehm.info/gc/gc_bench.html, Nov 2015.
    [2]
    (Last Accessed).
    [3]
    Huffman encoding trees. https://mitpress.mit.edu/ sicp/full-text/sicp/book/node41.html, Nov 2015.
    [4]
    (Last Accessed).
    [5]
    NoFib: Haskell Benchmark Suite. http://git.haskell. org/nofib.git, Nov 2015. (Last accessed).
    [6]
    PLT Scheme Benchmark Suite. http://svn.plt-scheme. org/plt/trunk/collects/tests/, Nov 2015.
    [7]
    (Last accessed).
    [8]
    A. W. Appel. Compiling with Continuations. Cambridge University Press, 2006.
    [9]
    R. Asati, A. Sanyal, A. Karkare, and A. Mycroft. Livenessbased garbage collection. In Compiler Construction - 23rd International Conference, CC 2014, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2014, Grenoble, France, April 5-13, 2014. Proceedings, pages 85–106, 2014.
    [10]
    R. E. Bryant. Graph-based algorithms for boolean function manipulation. IEEE Trans. Computers, 35(8):677–691, 1986.
    [11]
    M. M. T. Chakravarty, G. Keller, and P. Zadarnowski. A functional perspective on SSA optimisation algorithms. Electr. Notes Theor. Comput. Sci., 82(2):347–361, 2003.
    [12]
    O. Chitil. Type inference builds a short cut to deforestation. In Proceedings of the fourth ACM SIGPLAN International Conference on Functional Programming (ICFP ’99), Paris, France, September 27-29, 1999.
    [13]
    , pages 249–260, 1999.
    [14]
    W. D. Clinger. Proper tail recursion and space efficiency. In Proceedings of the ACM SIGPLAN ’98 Conference on Programming Language Design and Implementation (PLDI), Montreal, Canada, June 17-19, 1998, pages 174–185, 1998.
    [15]
    J. Fairbairn and S. Wray. Functional Programming Languages and Computer Architecture: Portland, Oregon, USA, September 14–16, 1987 Proceedings, chapter Tim: A simple, lazy abstract machine to execute supercombinators, pages 34– 45. Springer Berlin Heidelberg, Berlin, Heidelberg, 1987.
    [16]
    A. J. Gill, J. Launchbury, and S. L. Peyton Jones. A short cut to deforestation. In Proceedings of the conference on Functional programming languages and computer architecture, FPCA 1993, Copenhagen, Denmark, June 9-11, 1993, pages 223–232, 1993.
    [17]
    G. W. Hamilton. Compile-time garbage collection for lazy functional languages. In Proceedings of the International Workshop on Memory Management, IWMM ’95, pages 119– 144, London, UK, UK, 1995. Springer-Verlag.
    [18]
    M. Hirzel, A. Diwan, and J. Henkel. On the usefulness of type and liveness accuracy for garbage collection and leak detection. ACM Trans. Program. Lang. Syst., 24(6):593–624, 2002.
    [19]
    M. Hofmann and S. Jost. Static prediction of heap space usage for first-order functional programs. In Conference Record of POPL 2003: The 30th SIGPLAN-SIGACT Symposium on Principles of Programming Languages, New Orleans, Louisisana, USA, January 15-17, 2003, pages 185–197, 2003.
    [20]
    K. Inoue, H. Seki, and H. Yagi. Analysis of functional programs to detect run-time garbage cells. ACM Trans. Program. Lang. Syst., 10(4):555–578, 1988.
    [21]
    S. B. Jones and D. Le Métayer. Compile-time garbage collection by sharing analysis. In Proceedings of the Fourth International Conference on Functional Programming Languages and Computer Architecture, FPCA ’89, pages 54–74, New York, NY, USA, 1989. ACM.
    [22]
    A. Karkare, U. P. Khedker, and A. Sanyal. Liveness of heap data for functional programs. In Heap Analysis and Verification, HAV 2007, a satellite workshop of European Joint Conferences on Theory and Practice of Software, ETAPS 2007, March 25, 2007, Braga, Portugal, 2007.
    [23]
    A. Karkare, A. Sanyal, and U. P. Khedker. Effectiveness of garbage collection in MIT/GNU scheme. CoRR, abs/cs/0611093, 2006.
    [24]
    U. P. Khedker, A. Sanyal, and A. Karkare. Heap reference analysis using access graphs. ACM Trans. Program. Lang. Syst., 30(1), 2007.
    [25]
    P. Kumar, A. Sanyal, and A. Karkare. Liveness based garbage collection in lazy languages. CoRR, abs/1604.05841, 2016.
    [26]
    O. Lee, H. Yang, and K. Yi. Static insertion of safe and effective memory reuse commands into ml-like programs. Sci. Comput. Program., 58(1-2):141–178, 2005.
    [27]
    N. Mitchell and C. Runciman. Losing functions without gaining data: another look at defunctionalisation. In Proceedings of the 2nd ACM SIGPLAN Symposium on Haskell, Haskell 2009, Edinburgh, Scotland, UK, 3 September 2009, pages 13– 24, 2009.
    [28]
    M. Mohri and M.-J. Nederhof. Regular approximation of context-free grammars through transformation. In Robustness in Language and Speech Technology. Kluwer Academic Publishers, 2000.
    [29]
    M. E. O’Neill and F. W. Burton. Smarter garbage collection with simplifiers. In Proceedings of the 2006 workshop on Memory System Performance and Correctness, San Jose, California, USA, October 11, 2006, pages 19–30, 2006.
    [30]
    S. L. Peyton Jones. The Implementation of Functional Programming Languages. Prentice-Hall, 1987.
    [31]
    N. Röjemo and C. Runciman. Lag, drag, void and use - heap profiling and space-efficient compilation revisited. In Proceedings of the 1996 ACM SIGPLAN International Conference on Functional Programming (ICFP ’96), Philadelphia, Pennsylvania, May 24-26, 1996.
    [32]
    , pages 34–41, 1996.
    [33]
    R. Shaham, E. K. Kolodner, and S. Sagiv. Heap profiling for space-efficient Java. In Proceedings of the 2001 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Snowbird, Utah, USA, June 20-22, 2001, pages 104–113, 2001.
    [34]
    R. Shaham, E. K. Kolodner, and S. Sagiv. Estimating the impact of heap liveness information on space consumption in Java. In Proceedings of The Workshop on Memory Systems Performance (MSP 2002), June 16, 2002 and The International Symposium on Memory Management (ISMM 2002), June 20-21, 2002, Berlin, Germany, pages 171–182, 2002.
    [35]
    R. Shaham, E. Yahav, E. K. Kolodner, and S. Sagiv. Establishing local temporal heap safety properties with applications to compile-time memory management. In Static Analysis, 10th International Symposium, SAS 2003, San Diego, CA, USA, June 11-13, 2003, Proceedings, pages 483–503, 2003.
    [36]
    Z. Shao and A. W. Appel. Efficient and safe-for-space closure conversion. ACM Trans. Program. Lang. Syst., 22(1):129– 161, 2000.
    [37]
    O. Shivers. Control-flow analysis in scheme. In Proceedings of the ACM SIGPLAN’88 Conference on Programming Language Design and Implementation (PLDI), Atlanta, Georgia, USA, June 22-24, 1988, pages 164–174, 1988.
    [38]
    S. Thomas. Garbage collection in shared-environment closure reducers: Space-efficient depth first copying using a tailored approach. Information Processing Letters, 56(1):1 – 7, 1995.
    [39]
    M. Tofte and L. Birkedal. A region inference algorithm. ACM Trans. Program. Lang. Syst., 20(4):724–767, 1998.
    [40]
    P. Wadler. Deforestation: Transforming programs to eliminate trees. In ESOP ’88, 2nd European Symposium on Programming, Nancy, France, March 21-24, 1988, Proceedings, pages 344–358, 1988.

    Cited By

    View all
    • (2016)Liveness-based garbage collection for lazy languagesACM SIGPLAN Notices10.1145/3241624.292669851:11(122-133)Online publication date: 14-Jun-2016
    • (2016)Heap Abstractions for Static AnalysisACM Computing Surveys10.1145/293109849:2(1-47)Online publication date: 30-Jun-2016
    • (2023)Selecting Context-Sensitivity Modularly for Accelerating Object-Sensitive Pointer AnalysisIEEE Transactions on Software Engineering10.1109/TSE.2022.316223649:2(719-742)Online publication date: 1-Feb-2023

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    ISMM 2016: Proceedings of the 2016 ACM SIGPLAN International Symposium on Memory Management
    June 2016
    133 pages
    ISBN:9781450343176
    DOI:10.1145/2926697
    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]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 14 June 2016

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Garbage Collection
    2. Heap Analysis
    3. Lazy Languages
    4. Liveness Analysis
    5. Memory Management

    Qualifiers

    • Research-article

    Conference

    ISMM '16
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 72 of 156 submissions, 46%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)3
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 27 Jul 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2016)Liveness-based garbage collection for lazy languagesACM SIGPLAN Notices10.1145/3241624.292669851:11(122-133)Online publication date: 14-Jun-2016
    • (2016)Heap Abstractions for Static AnalysisACM Computing Surveys10.1145/293109849:2(1-47)Online publication date: 30-Jun-2016
    • (2023)Selecting Context-Sensitivity Modularly for Accelerating Object-Sensitive Pointer AnalysisIEEE Transactions on Software Engineering10.1109/TSE.2022.316223649:2(719-742)Online publication date: 1-Feb-2023

    View Options

    Get Access

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media