skip to main content
article
Free Access

An efficient on-the-fly cycle collection

Authors Info & Claims
Published:01 August 2007Publication History
Skip Abstract Section

Abstract

A reference-counting garbage collector cannot reclaim unreachable cyclic structures of objects. Therefore, reference-counting collectors either use a backup tracing collector infrequently, or employ a cycle collector to reclaim cyclic structures. We propose a new concurrent cycle collector, one that runs concurrently with the program threads, imposing negligible pauses (of around 1ms) on a multiprocessor.

Our new collector combines a state-of-the-art cycle collector [Bacon and Rajan 2001] with sliding-views collectors [Levanoni and Petrank 2001, 2006; Azatchi et al. 2003]. The use of sliding views for cycle collection yields two advantages. First, it drastically reduces the number of cycle candidates, which in turn drastically reduces the work required to record and trace these candidates. Consequentially, a large improvement in cycle collection efficiency is achieved. Second, it eliminates the theoretical termination problem that appeared in the earlier concurrent cycle collector. There, a rare race may delay the reclamation of an unreachable cyclic structure forever. The sliding-views cycle collector guarantees reclamation of all unreachable cyclic structures.

The proposed collector was implemented on the Jikes RVM and we provide measurements including a comparison between the use of backup tracing and the use of cycle collection with reference counting. To the best of our knowledge, such a comparison has not been reported before.

References

  1. Alpern, B., Attanasio, C. R., Cocchi, A., Lieber, D., Smith, S., Ngo, T., Barton, J. J., Hummel, S. F., Sheperd, J. C., and Mergen, M. 1999. Implementing Jalapeño in Java. In OOPSLA'99 ACM Conference on Object-Oriented Systems, Languages and Applications. ACM SIGPLAN Notices, vol. 34(10). ACM Press, Denver, CO, 314--324. Google ScholarGoogle Scholar
  2. Azatchi, H., Levanoni, Y., Paz, H., and Petrank, E. 2003. An on-the-fly mark and sweep garbage collector based on sliding view. OOPSLA'03 ACM Conference on Object-Oriented Systems, Languages, and Applications. ACM SIGPLAN Notices. ACM Press, Anaheim, CA. Google ScholarGoogle Scholar
  3. Azatchi, H. and Petrank, E. 2003. Integrating generations with advanced reference counting garbage collectors. In Proceedings of the Compiler Construction: 12th International Conference on Compiler Construction, CC 2003. Lecture Notes in Computer Science, vol. 2622. Springer-Verlag Heidelberg, Warsaw, Poland, 185--199. Google ScholarGoogle Scholar
  4. Bacon, D. F., Attanasio, C. R., Lee, H. B., Rajan, V. T., and Smith, S. 2001. Java without the coffee breaks: A nonintrusive multiprocessor garbage collector. In Proceedings of SIGPLAN 2001 Conference on Programming Languages Design and Implementation. ACM SIGPLAN Notices. ACM Press, Snowbird, Utah. Google ScholarGoogle Scholar
  5. Bacon, D. F. and Rajan, V. 2001. Concurrent cycle collection in reference counted systems. In Proceedings of the 15th European Conference on Object-Oriented Programming, ECOOP 2001, J. L. Knudsen, Ed. Lecture Notes in Computer Science, vol. 2072. Springer-Verlag, Budapest. Google ScholarGoogle Scholar
  6. Baker, H. G. 1978. List processing in real-time on a serial computer. Comm. ACM 21, 4, 280-- 294. Google ScholarGoogle Scholar
  7. Ben-Ari, M. 1982. On-the-fly garbage collection: New algorithms inspired by program proofs. In Automata, Languages and Programming. Ninth Colloquium, M. Nielsen and E. M. Schmidt, Eds. Springer-Verlag, Aarhus, Denmark, 14--22. Google ScholarGoogle Scholar
  8. Ben-Ari, M. 1984. Algorithms for on-the-fly garbage collection. ACM Trans. Program. Lang. Syst. 6, 3 (July), 333--344. Google ScholarGoogle Scholar
  9. Blackburn, S. M. and McKinley, K. S. 2003. Ulterior reference counting: Fast garbage collection without a long wait. OOPSLA'03 ACM Conference on Object-Oriented Systems, Languages, and Applications. ACM SIGPLAN Notices. ACM Press, Anaheim, CA. Google ScholarGoogle Scholar
  10. Bobrow, D. G. 1980. Managing re-entrant structures using reference counts. ACM Trans. Program. Lang. Syst. 2, 3 (July), 269--273. Google ScholarGoogle Scholar
  11. Boehm, H.-J., Demers, A. J., and Shenker, S. 1991. Mostly parallel garbage collection. ACM SIGPLAN Notices 26, 6, 157--164. Google ScholarGoogle Scholar
  12. Christopher, T. W. 1984. Reference count garbage collection. Software Practice and Experience 14, 6 (June), 503--507.Google ScholarGoogle Scholar
  13. Collins, G. E. 1960. A method for overlapping and erasure of lists. Comm. ACM 3, 12 (Dec.), 655--657. Google ScholarGoogle Scholar
  14. Demers, A., Weiser, M., Hayes, B., Boehm, H.-J., Bobrow, D. G., and Shenker, S. 1990. Combining generational and conservative garbage collection: Framework and implementations. In Conference Record of the Seventeenth Annual ACM Symposium on Principles of Programming Languages. ACM SIGPLAN Notices. ACM Press, San Francisco, CA, 261--269. Google ScholarGoogle Scholar
  15. Deutsch, L. P. and Bobrow, D. G. 1976. An efficient incremental automatic garbage collector. Comm. ACM 19, 9 (Sept.), 522--526. Google ScholarGoogle Scholar
  16. Dijkstra, E. W., Lamport, L., Martin, A. J., Scholten, C. S., and Steffens, E. F. M. 1978. On-the-fly garbage collection: An exercise in cooperation. Comm. ACM 21, 11 (Nov.), 965--975. Google ScholarGoogle Scholar
  17. Doligez, D. and Gonthier, G. 1994. Portable, unobtrusive garbage collection for multiprocessor systems. In Conference Record of the Twenty-first Annual ACM Symposium on Principles of Programming Languages. ACM SIGPLAN Notices. ACM Press, Portland, OR. Google ScholarGoogle Scholar
  18. Doligez, D. and Leroy, X. 1993. A concurrent generational garbage collector for a multi-threaded implementation of ML. In Conference Record of the Twentieth Annual ACM Symposium on Principles of Programming Languages. ACM SIGPLAN Notices. ACM Press, 113--123. Google ScholarGoogle Scholar
  19. Domani, T., Kolodner, E., and Petrank, E. 2000. A generational on-the-fly garbage collector for Java. In Proceedings of SIGPLAN 2000 Conference on Programming Languages Design and Implementation. ACM SIGPLAN Notices. ACM Press, Vancouver. Google ScholarGoogle Scholar
  20. Ellis, J. R., Li, K., and Appel, A. W. 1988. Real-time concurrent collection on stock multiprocessors. Tech. Rep. DEC--SRC--TR--25, DEC Systems Research Center, Palo Alto, CA. Feb.Google ScholarGoogle Scholar
  21. Endo, T., Taura, K., and Yonezawa, A. 1997. A scalable mark-sweep garbage collector on large-scale shared-memory machines. In Proceedings of High Performance Computing and Networking (SC'97). Google ScholarGoogle Scholar
  22. Flood, C., Detlefs, D., Shavit, N., and Zhang, C. 2001. Parallel garbage collection for shared memory multiprocessors. In Usenix Java Virtual Machine Research and Technology Symposium (JVM '01). Monterey, CA. Google ScholarGoogle Scholar
  23. Gries, D. 1977. An exercise in proving parallel programs correct. Comm. ACM 20, 12 (Dec.), 921--930. Google ScholarGoogle Scholar
  24. Hudson, R. L. and Moss, J. E. B. 2001. Sapphire: Copying GC without stopping the world. In Joint ACM Java Grande---ISCOPE 2001 Conference. Stanford University, CA. Google ScholarGoogle Scholar
  25. Jones, R. E. 1996. Garbage Collection: Algorithms for Automatic Dynamic Memory Management. Wiley, Chichester. Google ScholarGoogle Scholar
  26. Kermany, H. and Petrank, E. 2006. The compressor: Concurrent, incremental, and parallel compaction. In Proceedings of SIGPLAN 2006 Conference on Programming Languages Design and Implementation. ACM SIGPLAN Notices. ACM Press, Ottawa, Canada. Google ScholarGoogle Scholar
  27. Kolodner, E. K. and Petrank, E. 2004. Parallel copying garbage collection using delayed allocation. In Parallel Processing Letters. Vol. 14.Google ScholarGoogle Scholar
  28. Kung, H. T. and Song, S. W. 1977. An efficient parallel garbage collection system and its correctness proof. In IEEE Symposium on Foundations of Computer Science. IEEE Press, 120--131.Google ScholarGoogle Scholar
  29. Lamport, L. 1976. Garbage collection with multiple processes: an exercise in parallelism. In Proceedings of the 1976 International Conference on Parallel Processing. 50--54.Google ScholarGoogle Scholar
  30. Levanoni, Y. and Petrank, E. 1999. A scalable reference counting garbage collector. Tech. Rep. CS--0967, Technion---Israel Institute of Technology, Haifa, Israel. (Nov).Google ScholarGoogle Scholar
  31. Levanoni, Y. and Petrank, E. 2001. An on-the-fly reference counting garbage collector for Java. In OOPSLA'01 ACM Conference on Object-Oriented Systems, Languages and Applications. ACM SIGPLAN Notices, vol. 36(10). ACM Press, Tampa, FL. Google ScholarGoogle Scholar
  32. Levanoni, Y. and Petrank, E. 2006. An on-the-fly reference-counting garbage collector for Java. ACM Transactions on Programming Languages and Systems 28, 1 (Jan.), 1--69. Google ScholarGoogle Scholar
  33. Lins, R. D. 1992. Cyclic reference counting with lazy mark-scan. Information Processing Letters 44, 4, 215--220. Also Computing Laboratory Technical Report 75, University of Kent, July 1990. Google ScholarGoogle Scholar
  34. Lins, R. D. 2002. An efficient algorithm for cyclic reference counting. Information Processing Letters 83, 145--150. Google ScholarGoogle Scholar
  35. Martinez, A. D., Wachenchauzer, R., and Lins, R. D. 1990. Cyclic reference counting with local mark-scan. Information Processing Letters 34, 31--35. Google ScholarGoogle Scholar
  36. McBeth, J. H. 1963. On the reference counter method. Communications of the ACM 6, 9 (Sept.), 575. Google ScholarGoogle Scholar
  37. Moon, D. A. 1984. Garbage collection in a large LISP system. In Conference Record of the 1984 ACM Symposium on Lisp and Functional Programming, G. L. Steele, Ed. ACM Press, Austin, TX, 235--245. Google ScholarGoogle Scholar
  38. Nilsen, K. D., Mitra, S., and Lee, S. J. 2000. Method for efficient soft real-time execution of portable byte code computer programs. http://www.patentstorm.us/patents/6081665.html.Google ScholarGoogle Scholar
  39. Paz, H., Petrank, E., Bacon, D. F., Rajan, V., and Kolodner, E. K. 2005a. An efficient on-the-fly cycle collection. In Proceedings of the 14th International Conference on Compiler Construction. Springer-Verlag, Edinburgh. Google ScholarGoogle Scholar
  40. Paz, H., Petrank, E., and Blackburn, S. M. 2003. Age-oriented garbage collection. Tech. Rep. CS-2003-08, Technion, Israel Institute of Technology. Oct. http://www.cs.technion.ac.il/users/wwwb/cgi-bin/tr-info.cgi?2003/CS/CS-2003-08.Google ScholarGoogle Scholar
  41. Paz, H., Petrank, E., and Blackburn, S. M. 2005b. Age-oriented garbage collection. In Proceedings of the 14th International Conference on Compiler Construction. Springer-Verlag, Edinburgh.Google ScholarGoogle Scholar
  42. Printezis, T. and Detlefs, D. 2000. A generational mostly-concurrent garbage collector. In ISMM 2000 Proceedings of the Second International Symposium on Memory Management, T. Hosking, Ed. ACM SIGPLAN Notices, vol. 36(1). ACM Press, Minneapolis, MN. Google ScholarGoogle Scholar
  43. SPEC Benchmarks. 2000. Standard Performance Evaluation Corporation. http://www.spec.org/.Google ScholarGoogle Scholar
  44. Steele, G. L. 1975. Multiprocessing compactifying garbage collection. Comm. ACM 18, 9 (Sept.), 495--508. Google ScholarGoogle Scholar
  45. Steele, G. L. 1976. Corrigendum: Multiprocessing compactifying garbage collection. Comm. ACM 19, 6 (June), 354. Google ScholarGoogle Scholar
  46. Weizenbaum, J. 1963. Symmetric list processor. Comm. ACM 6, 9 (Sept.), 524--544. Google ScholarGoogle Scholar
  47. Wilson, P. R., Johnstone, M. S., Neely, M., and Boles, D. 1995. Dynamic storage allocation: A survey and critical review. In Proceedings of International Workshop on Memory Management, H. Baker, Ed. Lecture Notes in Computer Science, vol. 986. Springer-Verlag, Kinross, Scotland. Google ScholarGoogle Scholar

Index Terms

  1. An efficient on-the-fly cycle collection

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!