Java语言因其在软件工程上的优势而被广泛地用来进行服务器应用的开发.这些应用中通常存在着大量的长生命周期的对象.单一的经典的垃圾收集算法不能够有效地减少对长生命周期对象的重复处理.一种基于长生命周期对象的混合垃圾收集算法(LLH)被设计和实现.该算法结合了缩并,复制和分代收集的特点,通过这些经典算法的动态切换与协作来解决这一问题.实验结果表明,与经典的分代垃圾收集相比,LLH收集算法能够使SPECjbb2005的Throughput分值提高3%~25%.
With the advantages in software engineering, Java language is extensively applied for the development of server applications where there usually exist a large number of long-lived objects. No classical garbage collection algorithm can effectively decrease the repeated manipulations on those long-lived objects. This paper presents the design and implementation of a long- lived-object-based hybrid (LLH) garbage collection algorithm. It combines the features of compaction, copying and generation and takes advantage of the dynamic switching between them to solve the problems caused by long-lived objects. SPECjbb2005 is used to evaluate LLH algorithm and the results show that compared with generational garbage collection, LLH can improve the Throughput of the application by 3%-25%.