Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article

Free-Me: a static analysis for automatic individual object reclamation

Published: 11 June 2006 Publication History
  • Get Citation Alerts
  • Abstract

    Garbage collection has proven benefits, including fewer memory related errors and reduced programmer effort. Garbage collection, however, trades space for time. It reclaims memory only when it is invoked: invoking it more frequently reclaims memory quickly, but incurs a significant cost; invoking it less frequently fills memory with dead objects. In contrast, explicit memory management provides prompt low cost reclamation, but at the expense of programmer effort.This work comes closer to the best of both worlds by adding novel compiler and runtime support for compiler inserted frees to a garbage-collected system. The compiler's free-me analysis identifies when objects become unreachable and inserts calls to free. It combines a lightweight pointer analysis with liveness information that detects when short-lived objects die. Our approach differs from stack and region allocation in two crucial ways. First, it frees objects incrementally exactly when they become unreachable, instead of based on program scope. Second, our system does not require allocation-site lifetime homogeneity, and thus frees objects on some paths and not on others. It also handles common patterns: it can free objects in loops and objects created by factory methods.We evaluate free() variations for free-list and bump-pointer allocators. Explicit freeing improves performance by promptly reclaiming objects and reducing collection load. Compared to marksweep alone, free-me cuts total time by 22% on average, collector time by 50% to 70%, and allows programs to run in 17% less memory. This combination retains the software engineering benefits of garbage collection while increasing space efficiency and improving performance, and thus is especially appealing for real-time and space constrained systems.

    References

    [1]
    B. Alpern et al. Implementing Jalapeño in Java. In ACM Conference on Object-Oriented Programming Systems, Languages,and Applications, pages 314--324, Denver, CO, Nov. 1999.]]
    [2]
    B. Alpern et al. The Jalapeño virtual machine. IBM Systems Journal, 39(1):211--238, February 2000.]]
    [3]
    L. O. Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen, May 1994.]]
    [4]
    D. F. Bacon, P. Cheng, D. Grove, and M. T. Vechev. Syncopation: Generational real-time garbage collector in the metronome. In ACM Languages, Compilers, and Tools for Embedded Systems, pages 183--192, Chicago, IL, June 2005.]]
    [5]
    J. M. Barth. Shifting garbage collection overhead to compile time. Communications of the ACM, 20(7):513--518, July 1977.]]
    [6]
    E. D. Berger, B. G. Zorn, and K. S. McKinley. Reconsidering custom memory allocation. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 1--12, Seattle, WA, Nov. 2002.]]
    [7]
    S. M. Blackburn, P. Cheng, and K. S. McKinley. Myths and realities: The performance impact of garbage collection. In ACMSIGMETRICS Conference on Measurement & Modeling Computer Systems, pages 25--36, NY, NY, June 2004.]]
    [8]
    S. M. Blackburn, P. Cheng, and K. S. McKinley. Oil and water? High performance garbage collection in Java with JMTk. In International Conference on Software Engineering, pages 137--146, Scotland, UK, May 2004.]]
    [9]
    S. M. Blackburn, R. Garner, C. Hoffmann, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, S. Z. Guyer, A. Hosking, M. Jump, J. E. B. Moss, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo Benchmarks: Java benchmarking development and analysis. Technical Report TRCS-06-01, Deptartment of Computer Science, Austrailian National University, Mar. 2006. http://ali-www.cs.umass.edu/DaCapo/-Benchmarks.]]
    [10]
    B. Blanchet. Escape analysis for Java: Theory and practice. ACM Transactions on Programming Languages and Systems, 25(6):713--775, Nov. 2003.]]
    [11]
    S. Cherem and R. Rugina. Region analysis and transformation for Java programs. In ACM International Symposium on Memory Management, pages 85--96, Vancouver, BC, 2004.]]
    [12]
    W. Chin, F. Craciun, S. Qin, and M. Rinard. Region inference for object-oriented language. In ACM Conference on Programming Languages Design and Implementation, pages 243--354, Washington, DC, June 2004.]]
    [13]
    J. Choi, M. Gupta, M. J. Serrano, V. C. Sreedhar, and S. P. Midkiff. Stack allocation and synchronization optimizations for Java using escape analysis. ACM Transactions on Programming Languages and Systems, 25(6):876--910, Nov. 2003.]]
    [14]
    C. Click. Stack allocation, Jan. 2005. Personal Communication.]]
    [15]
    R. Cytron, J. Ferrante, B. Rosen, M. Wegman, and K. Zadeck. Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems, 13(4):451--490, Oct. 1991.]]
    [16]
    L. Eeckhout, A. Georges, and K. D. Bosschere. How Java programs interact with virtual machines at the microarchitectural level. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 244--358, Anaheim, CA, Oct. 2003.]]
    [17]
    Y. Feng and E. D. Berger. A locality-improving dynamic memory allocator. In ACM Conference on Memory System Performance, pages 1--12, Chicago, IL, June 2005.]]
    [18]
    R. P. Fitzgerald, T. B. Knoblock, E. Ruf, B. Steensgaard, and D. Tarditi. Marmot: An optimizing compiler for Java. Software-Practice and Experience, 30(3):199--232, 2000.]]
    [19]
    D. Gay and A. Aiken. Language support for regions. In ACM Conference on Programming Languages Design and Implementation, pages 70--80, Snowbird, UT, 2001.]]
    [20]
    D. Gay and B. Steensgaard. Fast escape analysis and stack allocation for object-based programs. In International Conference on Compiler Construction, pages 82--93, Berlin, Germany, 2000.]]
    [21]
    O. Gheorghioiu, A. Salcianu, and M. Rinard. Interprocedural compatibility analysis for static object preallocation. In ACM Symposium on the Principles of Programming Languages, pages 273--284, New Orleans, LA, Jan. 2003.]]
    [22]
    N. Hallenberg, M. Elsman, and M. Tofte. Combining region inference and garbage collection. In ACM Conference on Programming Languages Design and Implementation, pages 141--152, Berlin, Germany, June 2002.]]
    [23]
    M. Hertz and E. Berger. Quantifying the performance of garbage collection vs. explicit memory mananagement. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, San Diego, CA, Oct. 2005.]]
    [24]
    M. Hicks, G. Morrisett, D. Grossman, and T. Jim. Experience with safe manual memory-management in Cyclone. In ACM International Symposium on Memory Management, pages 73--84, Vancouver, BC, 2004.]]
    [25]
    M. Hirzel, A. Diwan, and J. Henkel. On the usefulness of type and liveness accuracy for garbage collection and leak detection. ACM Transactions on Programming Languages and Systems, 24(6):593--624, Nov. 2002.]]
    [26]
    H. Inoue, D. Stefanović, and S. Forrest. Object lifetime prediction in Java. Technical Report TR-CS-2003-28, University of New Mexico, May 2003.]]
    [27]
    Jikes RVM. IBM, 2005. http://jikesrvm.sourceforge.net.]]
    [28]
    S. B. Jones and D. Le Métayer. Compile-time garbage collection by sharing analysis. In ACM Inteornational Conference on Functional Programming Languages and Computer Architecture, pages 54--74, Nov. 1989.]]
    [29]
    D. Lea. A memory allocator. http://gee.cs.oswego.edu/dl/html/malloc.html, 1997.]]
    [30]
    O. Lee and K. Yi. Experiments on the effectiveness of an automatic insertion of memory reuses into XSML-like programs. In ACM International Symposium on Memory Management, pages 97--108, Vancouver, BC, 2004.]]
    [31]
    D. Marinov and R. O'Callahan. Object equality profiling. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 313--325, Anahiem, CA, Oct. 2003.]]
    [32]
    F. Qian and L. Hendren. An adaptive, region-based allocator for Java. In ACM International Symposium on Memory Management, Berlin, Germany, June 2002.]]
    [33]
    R. Shaham, E. K. Kolodner, and M. Sagiv. Heap profiling for spaceefficient Java. In ACM Conference on Programming Languages Design and Implementation, pages 104--133, Snowbird, UT, 2001.]]
    [34]
    R. Shaham, E. Yahav, E. K. Kolodner, and M. Sagiv. Establishing local temporal heap safety properties with application to compiletime memory management. In Static Analysis Symposium, pages 483--503, San Diego, CA, June 2003.]]
    [35]
    Standard Performance Evaluation Corporation. SPECjvm98 Documentation, release 1.03 edition, March 1999.]]
    [36]
    Standard Performance Evaluation Corporation. SPECjbb2000 (Java Business Benchmark) Documentation, release 1.01 edition, 2001.]]
    [37]
    M. Tofte and J. Talpin. Region-based memory management. Information and Computation, 1997.]]
    [38]
    D. M. Ungar. Generation scavenging: A non-disruptive high performance storage reclamation algorithm. In ACM Software Engineering Symposium on Practical Software Development Environments, pages 157--167, April 1984.]]
    [39]
    J. Whaley and M. Rinard. Compositional pointer and escape analysis for Java programs. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 187--206, Nov. 1999.]]

    Cited By

    View all
    • (2017)A Story of Parametric Trace Slicing, Garbage and Static AnalysisElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.254.1254(1-14)Online publication date: 23-Aug-2017
    • (2016)Directed test generation to detect loop inefficienciesProceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering10.1145/2950290.2950360(895-907)Online publication date: 1-Nov-2016
    • (2016)Efficient flow profiling for detecting performance bugsProceedings of the 25th International Symposium on Software Testing and Analysis10.1145/2931037.2931066(413-424)Online publication date: 18-Jul-2016
    • Show More Cited By

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 41, Issue 6
    Proceedings of the 2006 PLDI Conference
    June 2006
    426 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1133255
    Issue’s Table of Contents
    • cover image ACM Conferences
      PLDI '06: Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and Implementation
      June 2006
      438 pages
      ISBN:1595933204
      DOI:10.1145/1133981
    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: 11 June 2006
    Published in SIGPLAN Volume 41, Issue 6

    Check for updates

    Author Tags

    1. adaptive
    2. compiler-assisted
    3. copying
    4. generational
    5. liveness
    6. locality
    7. mark-sweep
    8. pointer analysis

    Qualifiers

    • Article

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

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

    Other Metrics

    Citations

    Cited By

    View all
    • (2017)A Story of Parametric Trace Slicing, Garbage and Static AnalysisElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.254.1254(1-14)Online publication date: 23-Aug-2017
    • (2016)Directed test generation to detect loop inefficienciesProceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering10.1145/2950290.2950360(895-907)Online publication date: 1-Nov-2016
    • (2016)Efficient flow profiling for detecting performance bugsProceedings of the 25th International Symposium on Software Testing and Analysis10.1145/2931037.2931066(413-424)Online publication date: 18-Jul-2016
    • (2015)Data structure aware garbage collectorProceedings of the 2015 International Symposium on Memory Management10.1145/2754169.2754176(28-40)Online publication date: 14-Jun-2015
    • (2015)FACADEProceedings of the Twentieth International Conference on Architectural Support for Programming Languages and Operating Systems10.1145/2694344.2694345(675-690)Online publication date: 14-Mar-2015
    • (2013)Elephant tracksACM SIGPLAN Notices10.1145/2555670.246648448:11(109-118)Online publication date: 20-Jun-2013
    • (2013)Elephant tracksProceedings of the 2013 international symposium on memory management10.1145/2491894.2466484(109-118)Online publication date: 20-Jun-2013
    • (2013)Elephant tracksProceedings of the 2013 international symposium on memory management10.1145/2464157.2466484(109-118)Online publication date: 20-Jun-2013
    • (2013)Light-weight resource leak testing based on finalisersIET Software10.1049/iet-sen.2013.00267:6(308-316)Online publication date: 1-Dec-2013
    • (2023)From Leaks to Fixes: Automated Repairs for Resource Leak WarningsProceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3611643.3616267(159-171)Online publication date: 30-Nov-2023
    • Show More Cited By

    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