Abstract:
For the Garbage Collection(GC) low efficiency in embedded virtual machine environment,this paper proposes an improved generational GC algorithm based on lifespan prediction.Through the prediction of object’s lifespan,objects predicted to be long-lived are allocated directly into the old generation,and the need to copy such objects from the young generation is eliminated,thereby reducing the execution time of GC.In young generation,this paper adopts a kind of un-stop-the-world strategy which objects allocation and promotion perform concurrently.In old generation,it uses lazy-buddy algorithm combining with mark-sweep algorithm to achieve fast allocation and recovery.It not only avoids the copy operation,but also controls the amount of memory fragmentation.Experimental results show that,with this algorithm,the GC time decreases by about 23.9% and the program running time decreases by about 17.2%,the overall system execution performance is significantly improved.
Key words:
virtual machine,
Garbage Collection(GC),
lifespan prediction,
generation,
Lazy-buddy algorithm,
Mark-sweep algorithm
摘要:
针对嵌入式虚拟机中垃圾收集效率低的问题,提出一种新的分代式垃圾收集方法。通过对分配对象的生命期进行预测,将生命期长的对象直接分配到年长代,减少了从年轻代到年长代复制的数量,进而缩短垃圾回收的执行时间。在分代内收集方面,年轻代实现一种对象分配和垃圾收集同时进行的非暂停模式,年长代使用lazy-buddy算法结合mark-sweep算法的综合策略,实现空间的快速分配和回收,既避免了对象拷贝操作,又控制了内存碎片数量。实验结果表明,该算法能够使垃圾收集时间减少约23.9%,用例运行时间减少约17.2%,系统整体执行性能得到明显提升。
关键词:
虚拟机,
垃圾收集,
生命期预测,
分代,
Lazy-buddy算法,
Mark-sweep算法
CLC Number:
ZHANG Tao,BAI Ruilin,ZOU Junyu. Generational Garbage Collection Algorithm Based on Lifespan Prediction[J]. Computer Engineering.
张涛,白瑞林,邹骏宇. 基于生命期预测的分代式垃圾收集算法[J]. 计算机工程.