skip to main content
research-article
Open access

Optimal Choice of When to Garbage Collect

Published: 04 January 2019 Publication History

Abstract

We consider the ultimate limits of program-specific garbage collector (GC) performance for real programs. We first characterize the GC schedule optimization problem. Based on this characterization, we develop a linear-time dynamic programming solution that, given a program run and heap size, computes an optimal schedule of collections for a non-generational collector. Using an analysis of a heap object graph of the program, we compute a property of heap objects that we call their pre-birth time. This information enables us to extend the non-generational GC schedule problem to the generational GC case in a way that also admits a dynamic programming solution with cost quadratic in the length of the trace (number of objects allocated). This improves our previously reported approximately optimal result. We further extend the two-generation dynamic program to any number of generations, allowing other generalizations as well. Our experimental results for two generations on traces from Java programs of the DaCapo benchmark suite show that there is considerable promise to reduce garbage collection costs for some programs by developing program-specific collection policies. For a given space budget, optimal schedules often obtain modest but useful time savings, and for a given time budget, optimal schedules can obtain considerable space savings.

Cited By

View all
  • (2023)iAware: Interaction Aware Task Scheduling for Reducing Resource Contention in Mobile SystemsACM Transactions on Embedded Computing Systems10.1145/360939122:5s(1-24)Online publication date: 31-Oct-2023
  • (2023)A Novel Automatic Garbage Collector Tool for C/C++ Programs2023 International Conference on Computational Intelligence and Sustainable Engineering Solutions (CISES)10.1109/CISES58720.2023.10183570(657-662)Online publication date: 28-Apr-2023
  • (2019)Learning when to garbage collect with random forestsProceedings of the 2019 ACM SIGPLAN International Symposium on Memory Management10.1145/3315573.3329983(53-63)Online publication date: 23-Jun-2019

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Programming Languages and Systems
ACM Transactions on Programming Languages and Systems  Volume 41, Issue 1
March 2019
235 pages
ISSN:0164-0925
EISSN:1558-4593
DOI:10.1145/3299867
Issue’s Table of Contents
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 the author(s) 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: 04 January 2019
Accepted: 01 August 2018
Revised: 01 August 2018
Received: 01 March 2018
Published in TOPLAS Volume 41, Issue 1

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Automatic storage management
  2. garbage collection
  3. optimal schedules

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)147
  • Downloads (Last 6 weeks)17
Reflects downloads up to 03 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2023)iAware: Interaction Aware Task Scheduling for Reducing Resource Contention in Mobile SystemsACM Transactions on Embedded Computing Systems10.1145/360939122:5s(1-24)Online publication date: 31-Oct-2023
  • (2023)A Novel Automatic Garbage Collector Tool for C/C++ Programs2023 International Conference on Computational Intelligence and Sustainable Engineering Solutions (CISES)10.1109/CISES58720.2023.10183570(657-662)Online publication date: 28-Apr-2023
  • (2019)Learning when to garbage collect with random forestsProceedings of the 2019 ACM SIGPLAN International Symposium on Memory Management10.1145/3315573.3329983(53-63)Online publication date: 23-Jun-2019

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

HTML Format

View this article in HTML Format.

HTML Format

Login options

Full Access

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media