ABSTRACT
Modern garbage collectors rely on read and write barriers imposed on heap accesses by the mutator, to keep track of references between different regions of the garbage collected heap, and to synchronize actions of the mutator with those of the collector. It has been a long-standing untested assumption that barriers impose significant overhead to garbage-collected applications. As a result, researchers have devoted effort to development of optimization approaches for elimination of unnecessary barriers, or proposed new algorithms for garbage collection that avoid the need for barriers while retaining the capability for independent collection of heap partitions. On the basis of the results presented here, we dispel the assumption that barrier overhead should be a primary motivator for such efforts.
We present a methodology for precise measurement of mutator overheads for barriers associated with mutator heap accesses. We provide a taxonomy of different styles of barrier and measure the cost of a range of popular barriers used for different garbage collectors within Jikes RVM. Our results demonstrate that barriers impose surprisingly low cost on the mutator, though results vary by architecture. We found that the average overhead for a reasonable generational write barrier was less than 2% on average, and less than 6% in the worst case. Furthermore, we found that the average overhead of a read barrier consisting of just an unconditional mask of the low order bits read on the PowerPC was only 0.85%, while on the AMD it was 8.05%. With both read and write barriers, we found that second order locality effects were sometimes more important than the overhead of the barriers themselves, leading to counter-intuitive speedups in a number of situations.
- Alpern, B., Attanasio, C. R., Barton, J. J., Cocchi, A., Hummel, S. F., Lieber, D., Ngo, T., Mergen, M., Shepherd, J. C., and Smith, S. Implementing Jalapeño in Java. In, pp. 314--324. Google ScholarDigital Library
- Appel, A. W. Simple generational garbage collection and fast allocation. Software---Practice and Experience 19, 2 (Feb. 1989), 171--183. Google ScholarDigital Library
- Arnold, M., Fink, S. J., Grove, D., Hind, M., and Sweeney, P. F. Adaptive optimization in the Jalapeño JVM. In Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications(Minneapolis, Minnesota, Oct.). ACM SIGPLAN Notices 35, 10 (Oct. 2000), pp. 47--65. Google ScholarDigital Library
- Azagury, A., Kolodner, E. K., Petrank, E., and Yehudai, Z. Combining card marking with remembered sets: How to save scanning time. In ISMM'98 pp. 10--19. Google ScholarDigital Library
- Bacon, D. F., Cheng, P., and Rajan, V.T. A real-time garbage collector with low overhead and consistent utilization. In Conference Record of the ACM Symposium on Principles of Programming Languages(New Orleans, Lousiana, Jan.). ACM SIGPLAN Notices 38, 1 (Jan. 2003), pp.285--298. Google ScholarDigital Library
- Blackburn, S., and McKinley, K.S. In or out?: Putting write barriers in their place. In Proceedings of the ACM International Symposium on Memory anagement(Berlin, Germany, Jun., 2002). ACM SIGPLAN Notices 38 2(Feb. 2003), pp. 281--29. Google ScholarDigital Library
- Blackburn, S., and McKinley, K.S. Ulterior reference counting: fast garbage collection without a long wait. In OOPSLA'03 oopsla03, pp. 344--358. Google ScholarDigital Library
- Blackburn, S. M., Cheng, P., and McKinley, K. S. Myths and reality: The performance impact of garbage collection. In ACM International Conference on Measurement and Modeling of Computer Systems(New York, New York, June). 2004, p. To appear. Google ScholarDigital Library
- Blackburn, S.M., Jones, R. E., McKinley, K. S., and Moss, J. E.B. Beltway: Getting around garbage collection gridlock. In Proceedings of the ACM Conference on Programming Language Design and Implementation(Berlin, Germany, June). ACM SIGPLAN Notices 37, 5 (May 2002), pp. 153--164. Google ScholarDigital Library
- Brahnmath, K., Nystrom, N., Hosking, A. L., and Cutts, Q. Swizzle barrier optimizations for orthogonal persistence in Java. In Proceedings of the Third International Workshop on Persistence and Java/(Tiburon, California, August 1998), R. Morrison M. Jordan, and M. Atkinson, Eds. Advances in Persistent Object Systems. Morgan Kaufmann, 1999, pp. 268--278. Google ScholarDigital Library
- Brooks, R.A. Trading data space for reduced time and code space in real-time garbage collection on stock hardware. In Proceedings of the ACM Conference on Lisp and Functional Programming(Austin, Texas, Aug.). 1984, pp. 256--262. Google ScholarDigital Library
- Caudill, P. J., and Wirfs-Brock, A. A third generation Smalltalk-80 implementation. In Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications/Portland, Oregon, Sept.). ACM SIGPLAN Notices 21, 11 (Nov. 1986), pp. 119--130. Google ScholarDigital Library
- Hirzel, M., Diwan, A., and Hertz, M. Connectivity-based garbage collection. In pp. 359--373.Google Scholar
- Hosking, A. L., and Hudson, R. L. Remembered sets can also play cards. In Proceedings of the OOPSLA Workshop on Memory Management and Garbage Collection (Washington, DC, Sept.). 1993.Google Scholar
- Hosking, A. L., and Moss, J. E. B. Protection traps and alternatives for memory management of an object-oriented language. In Proceedings of the ACM Symposium on Operating Systems Principles (Asheville, North Carolina, Dec.). ACM Operating Systems Review 27, 5 (Dec. 1993), pp. 106--119. Google ScholarDigital Library
- Hosking, A. L., Moss, J. E. B., and Stefanoviç D. A comparative performance evaluation of write barrier implementations. In Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications (Vancouver, Canada, Oct.). ACM SIGPLAN Notices 27, 10 (Oct. 1992), pp.92--109. Google ScholarDigital Library
- Hosking, A. L., Nystrom, N., Cutts, Q., and Brahnmath, K. Optimizing the read and write barriers for orthogonal persistence. In Proceedings of the Eighth International Workshop on Persistent Object Systems (Tiburon, California, August 1998), R. Morrison, M. Jordan, and M. Atkinson, Eds. Advances in Persistent Object Systems. Morgan Kaufmann, 1999, pp.149--159. Google ScholarDigital Library
- Hudson, R. L., and Moss, J. E. B. Incremental collection of mature objects. In Proceedings of the International Workshop on Memory Management (St. Malo, France, Sept.), Y. Bekkers and J. Cohen, Eds. vol. 637 of Lecture Notes in Computer Science. Springer-Verlag, 1992, pp. 388--403. Google ScholarDigital Library
- Proceedings of the ACM International Symposium on Memory Management (Vancouver, Canada, Oct., 1998). ACM SIGPLAN Notices 34, 3 (Mar. 1999).Google Scholar
- Jones, R., and Lins, R. Garbage Collection: Algorithms for Automatic Dynamic Memory Management. Wiley, May 1996. Chapter on distributed collection by Lins. Google ScholarDigital Library
- Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications (Anaheim, California, Nov.). ACM SIGPLAN Notices 38, 11 (Nov. 2003).Google ScholarDigital Library
- Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications (Denver, Colorado, Nov.). ACM SIGPLAN Notices 34, 10 (Oct. 1999).Google Scholar
- Pettersson, M. Linux Intel/x86 performance counters, 2003 http://user.it.uu.se/mikpe/linux/perfctr/.Google Scholar
- Roth, D. J., and Wise, D. S. One-bit counts between unique and sticky. In ISMM'98, pp. 49--56. Google ScholarDigital Library
- Seligmann, J., and 235-252, S. G. E. Incremental mature garbage collection using the Train algorithm. In Proceedings of the European Conference on Object-Oriented Programming (AAarhus, Denmark, Aug.). vol. 952 of Lecture Notes in Computer Science. Springer-Verlag, 1995, pp. 235--252. Google ScholarDigital Library
- Sobalvarro, P. G. A lifetime-based garbage collector for LISP systems on general-purpose computers, 1988. B.S. Thesis, Dept. of EECS, Massachusetts Institute of Technology, Cambridge. Google ScholarDigital Library
- SPECjvm98 benchmarks, 1998.http://www.spec.org/osg/jvm98.Google Scholar
- SPECjbb2000 benchmarks, 2000.http://www.spec.org/jbb2000.Google Scholar
- Stefanoviç, D., McKinley, K. S., and Moss, J. E. B. Age-based garbage collection. In OOPSLA'99 oopsla99, pp. 370--381. Google ScholarDigital Library
- Ungar, D.Generation scavenging: A non-disruptive high performance storage reclamation algorithm. In Proceedings of the ACM Symposium on Practical Software Development Environments(Pittsburgh, Pennsylvania, Apr.). 1984, pp. 157--167. Google ScholarDigital Library
- Wilson, P. R., and Moher, T. G. A ``card-marking'' scheme for controlling intergenerational references in generation-based garbage collection on stock hardware. ACM SIGPLAN Notices 24, 5 (May 1989), 87--92. Google ScholarDigital Library
- Wilson, P. R., and Moher, T. G. Design of the opportunistic garbage collector. In Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications (New Orleans, Louisiana, Oct.). ACM SIGPLAN Notices 24, 10 (Oct. 1989), pp. 23--35. Google ScholarDigital Library
- Zee, K., and Rinard, M. C. Write barrier removal by static analysis. In Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications (Seattle, Washington, Nov.). ACM SIGPLAN Notices 37, 11 (Nov. 2002), pp. 191--210. Google ScholarDigital Library
- Zorn, B. Barrier methods for garbage collection. Tech. Rep. CU-CS-494-90, University of Colorado at Boulder, Nov. 1990.Google Scholar
Index Terms
- Barriers: friend or foe?
Recommendations
Barriers reconsidered, friendlier still!
ISMM '12Read and write barriers mediate access to the heap allowing the collector to control and monitor mutator actions. For this reason, barriers are a powerful tool in the design of any heap management algorithm, but the prevailing wisdom is that they impose ...
Controlling garbage collection and heap growth to reduce the execution time of Java applications
In systems that support garbage collection, a tension exists between collecting garbage too frequently and not collecting it frequently enough. Garbage collection that occurs too frequently may introduce unnecessary overheads at the risk of not ...
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