Garbage collection using a finite liveness domain

Aman Bansal, Saksham Goel, Preey Shah, A. Sanyal, Prasanna Kumar
{"title":"Garbage collection using a finite liveness domain","authors":"Aman Bansal, Saksham Goel, Preey Shah, A. Sanyal, Prasanna Kumar","doi":"10.1145/3381898.3397208","DOIUrl":null,"url":null,"abstract":"Functional languages manage heap data through garbage collection. Since static analysis of heap data is difficult, garbage collectors conservatively approximate the liveness of heap objects by reachability i.e. every object that is reachable from the root set is considered live. Consequently, a large amount of memory that is reachable but not used further during execution is left uncollected by the collector. Earlier attempts at liveness-based garbage collection for languages supporting structured types were based on analyses that considered arbitrary liveness values, i.e. they assumed that any substructure of the data could be potentially live. This made the analyses complex and unscalable. However, functional programs traverse structured data like lists in identifiable patterns. We identify a set of eight usage patterns that we use as liveness values. The liveness analysis that accompanies our garbage collector is based on this set; liveness arising out of other patterns of traversal are conservatively approximated by this set. This restriction to a small set of liveness values reaps several benefits -- it results in a simple liveness analysis which scales to much larger programs with minimal loss of precision, enables the use of a faster collection technique, and is extendable to higher-order programs. Our experiments with a purely functional subset of Scheme show a reduction in the analysis time by orders of magnitude. In addition, the minimum heap size required to run programs is comparable with a liveness-based collector with unrestricted liveness values, and in situations where memory is limited, the garbage collection time is lower than its reachability counterpart.","PeriodicalId":301629,"journal":{"name":"Proceedings of the 2020 ACM SIGPLAN International Symposium on Memory Management","volume":"34 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-06-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 2020 ACM SIGPLAN International Symposium on Memory Management","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3381898.3397208","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 1

Abstract

Functional languages manage heap data through garbage collection. Since static analysis of heap data is difficult, garbage collectors conservatively approximate the liveness of heap objects by reachability i.e. every object that is reachable from the root set is considered live. Consequently, a large amount of memory that is reachable but not used further during execution is left uncollected by the collector. Earlier attempts at liveness-based garbage collection for languages supporting structured types were based on analyses that considered arbitrary liveness values, i.e. they assumed that any substructure of the data could be potentially live. This made the analyses complex and unscalable. However, functional programs traverse structured data like lists in identifiable patterns. We identify a set of eight usage patterns that we use as liveness values. The liveness analysis that accompanies our garbage collector is based on this set; liveness arising out of other patterns of traversal are conservatively approximated by this set. This restriction to a small set of liveness values reaps several benefits -- it results in a simple liveness analysis which scales to much larger programs with minimal loss of precision, enables the use of a faster collection technique, and is extendable to higher-order programs. Our experiments with a purely functional subset of Scheme show a reduction in the analysis time by orders of magnitude. In addition, the minimum heap size required to run programs is comparable with a liveness-based collector with unrestricted liveness values, and in situations where memory is limited, the garbage collection time is lower than its reachability counterpart.
使用有限活动域的垃圾收集
函数式语言通过垃圾收集管理堆数据。由于对堆数据进行静态分析是困难的,所以垃圾收集器保守地通过可达性来近似堆对象的活跃度,即从根集中可到达的每个对象都被认为是活跃的。因此,收集器不会收集可访问但在执行期间未进一步使用的大量内存。早期对支持结构化类型的语言进行基于活跃度的垃圾收集的尝试是基于考虑任意活跃度值的分析,也就是说,它们假设数据的任何子结构都可能是活跃的。这使得分析变得复杂且不可伸缩。然而,函数式程序以可识别的模式遍历结构化数据,如列表。我们确定了一组八种使用模式,我们将其作为生活价值。我们的垃圾收集器附带的活性分析是基于这个集合的;由其他遍历模式产生的活度保守地近似于这个集合。这种对一小组活跃度值的限制带来了几个好处——它产生了一个简单的活跃度分析,可以在最小的精度损失下扩展到更大的程序,允许使用更快的收集技术,并且可以扩展到更高阶的程序。我们对Scheme的纯功能子集进行的实验表明,分析时间减少了几个数量级。此外,运行程序所需的最小堆大小与活动值不受限制的基于活动的收集器相当,并且在内存有限的情况下,垃圾收集时间低于其可达性对应项。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信