A simple and efficient algorithm for cycle collection

Chin Yang Lin, Ting Wei Ho

Research output: Contribution to journalArticle

8 Citations (Scopus)


The lack of collecting cyclic garbage is generally considered the major weakness of reference counting. Reference counted systems handle this problem by incorporating either a global tracing collector, or a "partial" tracing collector that considers only the cycle candidates but needs several traces on them. In particular, the latter has become a preferred one as it has better scalability and locality (no need to scan the entire heap). This paper presents a new "lightweight" cyclic reference counting algorithm, which is based on partial tracing and deals with the cycle problem in a simpler and more efficient way. By exploiting the lightweight hypothesis that considers a single sub-graph, instead of individual cycles, as the basic unit of cycle collection, the algorithm can detect garbage cycles in a single trace. In addition, we propose a technique for eliminating redundant scans over garbage objects, thus improving the efficiency of the algorithm. The pseudocode and its correctness proof are also presented. Finally, an implementation based on Jikes Research Virtual Machine is provided to demonstrate the effectiveness of the new algorithm.

Original languageEnglish
Pages (from-to)7-13
Number of pages7
JournalACM SIGPLAN Notices
Issue number3
Publication statusPublished - 2007 Mar 1


All Science Journal Classification (ASJC) codes

  • Computer Science(all)

Cite this