arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1604.05841cs.PL
收藏

基于活性的惰性语言垃圾回收

Liveness-Based Garbage Collection for Lazy Languages

Prasanna Kumar. K, Amitabha Sanyal, Amey Karkare

摘要:

我们考虑的问题,减少运行懒惰的一阶函数程序所需的内存。我们的方法是分析程序的堆分配数据的活性。分析结果用于在垃圾回收期间仅保留活动数据--可访问数据的子集。结果是回收的垃圾增加,程序的峰值内存需求减少。虽然这种技术已经被证明可以为渴望一阶语言带来好处,但缺乏可静态确定的执行顺序和闭包的存在对懒惰语言提出了新的挑战。这些都需要在活性分析本身和垃圾收集器的设计中进行更改。为了显示我们的方法的有效性,我们实现了一个复制收集器,它使用活性分析的结果来保存活对象,两者都被评估(即,在WHNF中)和关闭。我们的实验证实,对于使用基于活动的垃圾收集器运行的程序,峰值内存需求显著降低。此外,收集数量的大幅减少确保了尽管使用了更复杂的垃圾收集器,但使用活跃度和基于可达性的收集器运行的程序的执行时间仍然相当。

英文摘要:

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. While 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 (i.e., in WHNF) 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑