摘要
针对嵌入式虚拟机中垃圾收集效率低的问题,提出一种新的分代式垃圾收集方法。通过对分配对象的生命期进行预测,将生命期长的对象直接分配到年长代,减少了从年轻代到年长代复制的数量,进而缩短垃圾回收的执行时间。在分代内收集方面,年轻代实现一种对象分配和垃圾收集同时进行的非暂停模式,年长代使用lazybuddy算法结合mark-sw eep算法的综合策略,实现空间的快速分配和回收,既避免了对象拷贝操作,又控制了内存碎片数量。实验结果表明,该算法能够使垃圾收集时间减少约23.9%,用例运行时间减少约17.2%,系统整体执行性能得到明显提升。
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.
出处
《计算机工程》
CAS
CSCD
北大核心
2015年第7期71-74,81,共5页
Computer Engineering
基金
江苏高校优势学科建设工程基金资助项目(PAPD)
江苏省产学研前瞻性联合研究基金资助项目(BY2012056)