Abstract
Reference-counting is traditionally considered unsuitable for multiprocessor systems. According to conventional wisdom, the update of reference slots and reference-counts requires atomic or synchronized operations. In this work we demonstrate this is not the case by presenting a novel reference-counting algorithm suitable for a multiprocessor system that does not require any synchronized operation in its write barrier (not even a compare-and-swap type of synchronization). A second novelty of this algorithm is that it allows eliminating a large fraction of the reference-count updates, thus, drastically reducing the reference-counting traditional overhead. This article includes a full proof of the algorithm showing that it is safe (does not reclaim live objects) and live (eventually reclaims all unreachable objects).We have implemented our algorithm on Sun Microsystems' Java Virtual Machine (JVM) 1.2.2 and ran it on a four-way IBM Netfinity 8500R server with 550-MHz Intel Pentium III Xeon and 2 GB of physical memory. Our results show that the algorithm has an extremely low latency and throughput that is comparable to the stop-the-world mark and sweep algorithm used in the original JVM.
- Aho, A. V., Kernighan, B. W., and Weinberger, P. J. 1988. The AWK Programming Language. Addison-Wesley, Reading, MA. Google Scholar
- Appel, A. W., Ellis, J. R., and Li, K. 1988. Real-time concurrent collection on stock multiprocessors. ACM SIGPLAN Not. 23, 7, 11--20. Google Scholar
- Azatchi, H., Levanoni, Y., Paz, H., and Petrank, E. 2003. An on-the-fly mark and sweep garbage collector based on sliding views. See OOPSLA {2003}, 269--281. Google Scholar
- Azatchi, H. and Petrank, E. 2003. Integrating generations with advanced reference counting garbage collectors. In International Conference on Compiler Construction (CC'2003). Lecture Notes in Computer Science, vol. 2622. Springer, Berlin, Germany, 185--199. Google Scholar
- Bacon, D., Attanasio, D., Lee, H., and Smith, S. 2001. Java without the coffee breaks: A nonintrusive multiprocessor garbage collector. In Proceedings of the SIGPLAN 2001 Conference on Programming Languages Design and Implementation. ACM Press, New York, NY, 92--103. Google Scholar
- Bacon, D. and Rajan, V. 2001. Concurrent cycle collection in reference counted systems. In Proceedings of 15th European Conference on Object-Oriented Programming (ECOOP 2001, Budapest, Hungary). Google Scholar
- Baker, H. G. 1978. List processing in real-time on a serial computer. Commun. ACM 21, 4, 280--94. Google Scholar
- Baker, H. G. 1994. Minimizing reference count updating with deferred and anchored pointers for functional data structures. ACM SIGPLAN Not. 29, 9, 38--43. Google Scholar
- Barth, J. M. 1977. Shifting garbage collection overhead to compile time. Commun. ACM 20, 7 (July), 513--518. Google Scholar
- Blackburn, S. and McKinley, K. 2003. Ulterior reference counting: Fast garbage collection without a long wait. See OOPSLA {2003}, 344--358. Google Scholar
- Boehm, H.-J., Demers, A. J., and Shenker, S. 1991. Mostly parallel garbage collection. ACM SIGPLAN Not. 26, 6, 157--164. Google Scholar
- Chikayama, T. and Kimura, Y. 1987. Multiple reference management in Flat GHC. In 4th International Conference on Logic Programming. MIT Press, Cambridge, MA, 276--293.Google Scholar
- Collins, G. E. 1960. A method for overlapping and erasure of lists. Commun. ACM 3, 12 (Dec.), 655--657. Google Scholar
- Crammond, J. 1988. A garbage collection algorithm for shared memory parallel processors. Int. J. Parall. Programm. 17, 6, 497--522. Google Scholar
- DeTreville, J. 1990. Experience with concurrent garbage collectors for Modula-2+. Tech. rep. 64. DEC Systems Research Center, Palo Alto, CA.Google Scholar
- Deutsch, L. P. and Bobrow, D. G. 1976. An efficient incremental automatic garbage collector. Commun. ACM 19, 9 (Sept.), 522--526. Google Scholar
- 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. Commun. ACM 21, 11 (Nov.), 965--975. Google Scholar
- Doligez, D. and Gonthier, G. 1994. Portable, unobtrusive garbage collection for multiprocessor systems. In Proceedings of the 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM Press, New York, NY, 70--83. Google Scholar
- Doligez, D. and Leroy, X. 1993. A concurrent generational garbage collector for a multi-threaded implementation of ML. In Proceedings of the 20th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM Press, New York, NY, 113--123. Google Scholar
- Domani, T., Kolodner, E. K., Lewis, E., Salant, E. E., Barabash, K., Lahan, I., Petrank, E., Yanover, I., and Levanoni, Y. 2000. Implementing an on-the-fly garbage collector for Java. See Hosking {2000}, 155--166. Google Scholar
- Endo, T., Taura, K., and Yonezawa, A. 1997. A scalable mark-sweep garbage collector on large-scale shared-memory machines. In Proceedings of the Conference on High Performance Networking and Computing (SC'97). ACM Press, New York, NY, 1--14. Google Scholar
- 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). USENIX, Berkeley, CA. Google Scholar
- Furusou, S., Matsuoka, S., and Yonezawa, A. 1991. Parallel conservative garbage collection with fast allocation. In OOPSLA/ECOOP '91 Workshop on Garbage Collection in Object-Oriented Systems, Addendum to OOPSLA'91 Proceedings, P. R. Wilson and B. Hayes, Eds. ACM Press, New York, NY. Google Scholar
- Goldberg, A. and Robson, D. 1983. Smalltalk-80: The Language and Its Implementation. Addison-Wesley, Reading, MA. Google Scholar
- Halstead, R. H. 1985. Multilisp: A language for concurrent symbolic computation. ACM Trans. Program. Lang. Syst. 7, 4 (Oct.), 501--538. Google Scholar
- Herlihy, M. and Moss, J. E. B. 1990. Non-blocking garbage collection for multiprocessors. Tech. rep. CRL 90/9. DEC Cambridge Research Laboratory, Cambridge, MA.Google Scholar
- Hosking, A. L., Moss, J. E. B., and Stefanović, D. 1992. A comparative performance evaluation of write barrier implementations. In Proceedings of the Conference on Object-Oriented Programming, Systems, Languages, and Applications, A. Paepcke, Ed. ACM Press, New York, NY, 92--109. Google Scholar
- Hosking, T., Ed. 2000. ISMM 2000 Proceedings of the Second International Symposium on Memory Management. ACM Press, New York, NY.Google Scholar
- Hudson, R. L. and Moss, J. E. B. 2003. Copying garbage collection without stopping the world. Concurr. Computat.: Pract. Exp. 15, 3--5, 223--261.Google Scholar
- Jones, R. E. and Lins, R. 1996. Garbage Collection: Algorithms for Automatic Dynamic Memory Management. Wiley, Chichester, U.K. Google Scholar
- Kolodner, E. K. and Petrank, E. 2004. Parallel copying garbage collection using delayed allocation. Parall. Process. Lett. 14, 2. To appear.Google Scholar
- Levanoni, Y. and Petrank, E. 2001. An on-the-fly reference counting garbage collector for Java. In Proceedings of the 16th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications. ACM Press, New York, NY, 367--380. Google Scholar
- Lins, R. D. and Vasques, M. A. 1991. A comparative study of algorithms for cyclic reference counting. Tech. rep. 92. Computing Laboratory, The University of Kent at Canterbury. Canterbury, U.K.Google Scholar
- McBeth, J. H. 1963. On the reference counter method. Commun. ACM 6, 9, 575. Google Scholar
- Miller, J. S. and Epstein, B. 1990. Garbage collection in MultiScheme. In US/Japan Workshop on Parallel Lisp. Lecture Notes in Computer Science, vol. 441. Springer, Berlin, Germany, 138--160. Google Scholar
- OOPSLA. 2003. Proceedings of the 18th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications. ACM Press, New York, NY.Google Scholar
- Ossia, Y., Ben-Yitzhak, O., Goft, I., Kolodner, E. K., Leikehman, V., and Owshanko, A. 2002. A parallel, incremental and concurrent GC for servers. In Proceedings of the ACM SIGPLAN 2002 Conference on Programming Languages Design and Implementation. ACM Press, New York, NY, 129--140. Google Scholar
- O'Toole, J. W. and Nettles, S. M. 1994. Concurrent replicating garbage collection. In Proceedings of the 1994 ACM Conference on LISP and Functional Programming. ACM Press, New York, NY, 34--42. Google Scholar
- Park, Y. G. and Goldberg, B. 1995. Static analysis for optimising reference counting. Inf. Process. Lett. 55, 4 (Aug.), 229--234. Google Scholar
- Plakal, M. and Fischer, C. N. 2000. Concurrent garbage collection using program slices on multithreaded processors. See Hosking {2000}, 94--100. Google Scholar
- Printezis, T. and Detlefs, D. 2000. A generational mostly-concurrent garbage collector. See Hosking {2000}, 143--154. Google Scholar
- Riany, Y., Shavit, N., and Touitou, D. 1995. Towards a practical snapshot algorithm. In Proceedings of the 3rd Israeli Symposium on the Theory of Computing and Systems. IEEE Press, Los Alamitos, CA, 58--173. Google Scholar
- Roth, D. J. and Wise, D. S. 1999. One-bit counts between unique and sticky. In Proceedings of the First International Symposium on Memory Management, R. Jones, Ed. ACM SIGPLAN Not. 34, 3 (Mar.), 49--56. Google Scholar
- Sobalvarro, P. 1988. A lifetime-based garbage collector for Lisp systems on general-purpose computers. Tech. rep. AITR-1417. MIT AI Lab, Cambridge, MA. Also, Bachelor of Science thesis, Massachusetts Institute of Technology, Cambridge, MA. Google Scholar
- SPEC Benchmarks. 2000. Standard Performance Evaluation Corporation. Available online at http://www.spec.org/.Google Scholar
- Steele, G. L. 1975. Multiprocessing compactifying garbage collection. Commun. ACM 18, 9 (Sept.), 495--508. Google Scholar
- Stoye, W. R., Clarke, T. J. W., and Norman, A. C. 1984. Some practical methods for rapid combinator reduction. In Proceedings of the 1984 ACM Symposium on Lisp and Functional Programming, G. L. Steele, Ed. ACM Press, New York, NY, 159--166. Google Scholar
- Wall, L. and Schwartz, R. L. 1991. Programming Perl. O'Reilly and Associates, Inc, Sebastopol, CA. Google Scholar
- Weizenbaum, J. 1963. Symmetric list processor. Commun. ACM 6, 9 (Sept.), 524--544. Google Scholar
- Wise, D. S. 1993. Stop and one-bit reference counting. Inf. Process. Lett. 46, 5 (July), 243--249. Google Scholar
- Yuasa, T. 1990. Real-time garbage collection on general-purpose machines. J. Softw. Syst. 11, 3, 181--198. Google Scholar
- Zorn, B. 1990. Barrier methods for garbage collection. Tech. rep. CU-CS-494-90. University of Colorado, Boulder, CO.Google Scholar
Index Terms
An on-the-fly reference-counting garbage collector for java
Recommendations
A generational on-the-fly garbage collector for Java
PLDI '00: Proceedings of the ACM SIGPLAN 2000 conference on Programming language design and implementationAn on-the-fly garbage collector does not stop the program threads to perform the collection. Instead, the collector executes in a separate thread (or process) in parallel to the program. On-the-fly collectors are useful for multi-threaded applications ...
A generational on-the-fly garbage collector for Java
An on-the-fly garbage collector does not stop the program threads to perform the collection. Instead, the collector executes in a separate thread (or process) in parallel to the program. On-the-fly collectors are useful for multi-threaded applications ...
Implementing an on-the-fly garbage collector for Java
ISMM '00: Proceedings of the 2nd international symposium on Memory managementJava uses garbage collection (GC) for the automatic reclamation of computer memory no longer required by a running application. GC implementations for Java Virtual Machines (JVM) are typically designed for single processor machines, and do not ...






Comments