skip to main content
article

A fully concurrent garbage collector for functional programs on multicore processors

Published:04 September 2016Publication History
Skip Abstract Section

Abstract

This paper presents a concurrent garbage collection method for functional programs running on a multicore processor. It is a concurrent extension of our bitmap-marking non-moving collector with Yuasa's snapshot-at-the-beginning strategy. Our collector is unobtrusive in the sense of the Doligez-Leroy-Gonthier collector; the collector does not stop any mutator thread nor does it force them to synchronize globally. The only critical sections between a mutator and the collector are the code to enqueue/dequeue a 32 kB allocation segment to/from a global segment list and the write barrier code to push an object pointer onto the collector's stack. Most of these data structures can be implemented in standard lock-free data structures. This achieves both efficient allocation and unobtrusive collection in a multicore system. The proposed method has been implemented in SML#, a full-scale Standard ML compiler supporting multiple native threads on multicore CPUs. Our benchmark tests show a drastically short pause time with reasonably low overhead compared to the sequential bitmap-marking collector.

References

  1. A. W. Appel. Simple generational garbage collection and fast allocation. Softw. Pract. Exper., 19(2):171–183, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. Auhagen, L. Bergstrom, M. Fluet, and J. Reppy. Garbage collection for multicore NUMA machines. In Proceedings of the 2011 ACM SIGPLAN Workshop on Memory Systems Performance and Correctness, pp. 51–57, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. H. Azatchi, Y. Levanoni, H. Paz, and E. Petrank. An on-the-fly mark and sweep garbage collector based on sliding views. In Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications, pp. 269–281, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. G. E. Blelloch and P. Cheng. On bounding time and space for multiprocessor garbage collection. In Proceedings of the ACM SIGPLAN 1999 Conference on Programming Language Design and Implementation, pp. 104–117, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. P. Cheng and G. E. Blelloch. A parallel, real-time garbage collector. In Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation, pp. 125–136, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. C. Click, G. Tene, and M. Wolf. The pauseless GC algorithm. In Proceedings of the 1st ACM/USENIX International Conference on Virtual Execution Environments, pp. 46–56, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. D. Detlefs, C. Flood, S. Heller, and T. Printezis. Garbage-first garbage collection. In Proceedings of the 4th international symposium on Memory management, pp. 37–48, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. E. W. Dijkstra, L. Lamport, A. J. Martin, C. S. Scholten, and E. F. M. Steffens. On-the-fly garbage collection: an exercise in cooperation. Commun. ACM, 21:966–975, 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. D. Doligez and G. Gonthier. Portable, unobtrusive garbage collection for multiprocessor systems. In Proceedings of the 21st ACM SIGPLANSIGACT symposium on Principles of programming languages, pp. 70– 83, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. D. Doligez and X. Leroy. A concurrent, generational garbage collector for a multithreaded implementation of ML. In Proceedings of the 20th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pp. 113–123, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. T. Domani, E. K. Kolodner, and E. Petrank. A generational on-the-fly garbage collector for Java. In Proceedings of the ACM SIGPLAN 2000 conference on Programming language design and implementation, pp. 274–284, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. H. Flood, D. Detlefs, N. Shavit, and X. Zhang. Parallel garbage collection for shared memory multiprocessors. In Proceedings of the 2001 Symposium on JavaTM Virtual Machine Research and Technology Symposium - Volume 1, pp. 21–21, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Y. Levanoni and E. Petrank. An on-the-fly reference-counting garbage collector for Java. ACM Trans. Program. Lang. Syst., 28(1):1–69, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. Marlow, T. Harris, R. P. James, and S. Peyton Jones. Parallel generational-copying garbage collection with a block-structured heap. In Proceedings of the 7th international symposium on Memory management, pp. 11–20, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. S. Marlow and S. Peyton Jones. Multicore garbage collection with local heaps. In Proceedings of the international symposium on Memory management, pp. 21–32, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Y. Ossia, O. Ben-Yitzhak, I. Goft, E. K. Kolodner, V. Leikehman, and A. Owshanko. A parallel, incremental and concurrent GC for servers. In Proceedings of the ACM SIGPLAN 2002 Conference on Programming language design and implementation, pp. 129–140, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. F. Pizlo, D. Frampton, E. Petrank, and B. Steensgaard. Stopless: a real-time garbage collector for multiprocessors. In Proceedings of the 6th international symposium on Memory management, pp. 159–172, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. F. Pizlo, L. Ziarek, P. Maj, A. L. Hosking, E. Blanton, and J. Vitek. Schism: fragmentation-tolerant real-time garbage collection. In Proceedings of the 2010 ACM SIGPLAN conference on Programming language design and implementation, pp. 146–159, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. SML# project. http://www.pllab.riec.tohoku.ac.jp/smlsharp/.Google ScholarGoogle Scholar
  20. K. Ueno, A. Ohori, and T. Otomo. An efficient non-moving garbage collector for functional languages. In Proceedings of the 16th ACM SIGPLAN international conference on Functional programming, pp. 196–208, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. T. Yuasa. Real-time garbage collection on general-purpose machines. J. Syst. Softw., 11(3):181–198, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A fully concurrent garbage collector for functional programs on multicore processors

    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!