Abstract
Read 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 significant costs. However, changes in hardware and workloads make these costs a moving target. Here, we measure the cost of a range of useful barriers on a range of modern hardware and workloads. We confirm some old results and overturn others. We evaluate the microarchitectural sensitivity of barrier performance and the differences among benchmark suites. We also consider barriers in context, focusing on their behavior when used in combination, and investigate a known pathology and evaluate solutions. Our results show that read and write barriers have average overheads as low as 5.4% and 0.9% respectively. We find that barrier overheads are more exposed on the workload provided by the modern DaCapo benchmarks than on old SPECjvm98 benchmarks. Moreover, there are differences in barrier behavior between in-order and out-of- order machines, and their respective memory subsystems, which indicate different barrier choices for different platforms. These changing costs mean that algorithm designers need to reconsider their design choices and the nature of their resulting algorithms in order to exploit the opportunities presented by modern hardware.
- B. Alpern, D. Attanasio, J. J. Barton, M. G. Burke, P.Cheng, J.-D. Choi, A. Cocchi, S. J. Fink, D. Grove, M. Hind, S. F. Hummel, D. Lieber, V. Litvinov, M. Mergen, T. Ngo, J. R. Russell, V. Sarkar, M. J. Serrano, J. Shepherd, S. Smith, V. C. Sreedhar, H. Srinivasan, and J. Whaley. The JalapeÜno virtual machine. IBM System Journal, 39(1), Feb. 2000. doi: 10.1147/sj.391.0211. Google Scholar
Digital Library
- A. W. Appel. Simple generational garbage collection and fast allocation. Software: Practice and Experience, 19(2):171--183, Feb. 1989. doi: 10.1002/spe.4380190206. Google Scholar
Digital Library
- A. Azagury, E. K. Kolodner, E. Petrank, and Z. Yehudai. Combining card marking with remembered sets: How to save scanning time. In ACM International Symposium on Memory Management, pages 1 Indeed, Doug Lea has reported this pathology in his work on concurrent data structures for the java.util.concurrent library. 10--19, Vancouver, Canada, Oct. 1998. doi: 10.1145/286860. 286862. Google Scholar
Digital Library
- D. F. Bacon, P. Cheng, and V. T. Rajan. A real-time garbage collector with low overhead and consistent utilization. In Proceedings of the Thirtieth Annual ACM Symposium on the Principles of Programming Languages, pages 285--294, New Orleans, LA, Jan. 2003. doi: 10. 1145/604131.604155. Google Scholar
Digital Library
- S. M. Blackburn and A. Hosking. Barriers: Friend or foe? In ACM International Symposium on Memory Management, pages 143--151, Vancouver, Canada, Oct. 2004. doi: 10.1145/1029873. 1029891. Google Scholar
Digital Library
- S. M. Blackburn and K. S. McKinley. In or out? Putting write barriers in their place. In ACM International Symposium on Memory Management, pages 175--184, Berlin, Germany, June 2002. doi: 10.1145/ 512429.512452. Google Scholar
Digital Library
- S. M. Blackburn and K. S. McKinley. Immix: A mark-region garbage collector with space efficiency, fast collection, and mutator locality. In ACM Conference on Programming Language Design and Implementation, pages 22--32, Tuscon, AZ, June 2008. doi: 10.1145/ 1375581.1375586. Google Scholar
Digital Library
- S. M. Blackburn, M. Hirzel, R. Garner, and D. Stefanović. pjbb2005: The pseudoJBB benchmark. URL http://users.cecs.anu.edu.au/Üsteveb/research/research-infrastructure/pjbb2005.Google Scholar
- S. M. Blackburn, R. E. Jones, K. S. McKinley, and J. E. B. Moss. Beltway: Getting around garbage collection gridlock. In ACM Conference on Programming Language Design and Implementation, pages 153--164, Berlin, Germany, June 2002. doi: 10.1145/512529.512548. Google Scholar
Digital Library
- S. M. Blackburn, P. Cheng, and K. S. McKinley. Oil and water? High performance garbage collection in Java with MMTk. In Proceedings of the 26th International Conference on Software Engineering, pages 137--146, Scotland, UK, May 2004. doi: 10.1109/ICSE.2004. 1317436. Google Scholar
Digital Library
- S. M. Blackburn, R. Garner, C. Hoffman, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo benchmarks: Java benchmarking development and analysis. In ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications, pages 169--190, Oct. 2006. doi: 10.1145/1167515.1167488. Google Scholar
Digital Library
- R. A. Brooks. Trading data space for reduced time and code space in real-time garbage collection on stock hardware. In ACM Conference on Lisp and Functional Programming, pages 256--262, Austin, Texas, Aug. 1984. doi: 10.1145/800055.802042. Google Scholar
Digital Library
- P. J. Caudill and A. Wirfs-Brock. A third-generation Smalltalk-80 implementation. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 119--130, Portland, OR, Nov. 1986. doi: 10.1145/28697.28709. Google Scholar
Digital Library
- D. Dice. False sharing induced by card table marking, Feb. 2011. URL https://blogs.oracle.com/dave/entry/ false_sharing_induced_by_card.Google Scholar
- A. Fog. The microarchitecture of Intel, AMD and VIA CPUs. An optimization guide for assembly programmers and compiler makers. Copenhagen University College of Engineering, June 2011.Google Scholar
- L. Hellyer, R. E. Jones, and A. L. Hosking. The locality of concurrent write barriers. In ACM International Symposium on Memory Management, pages 83--92, Toronto, Canada, June 2010. doi: 10.1145/1806651.1806666. Google Scholar
Digital Library
- M. Hirzel, A. Diwan, and M. Hertz. Connectivity-based garbage collection. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 359--373, Anaheim, California, Nov. 2003. doi: 10.1145/949305.949337. Google Scholar
Digital Library
- A. L. Hosking and R. L. Hudson. Remembered sets can also play cards. In J. E. B. Moss, P. R. Wilson, and B. Zorn, editors, OOPSLA Workshop on Garbage Collection in Object-Oriented Systems, Oct. 1993. URL ftp://ftp.cs.utexas.edu/pub/garbage/GC93/hosking.ps.Google Scholar
- A. L. Hosking and J. E. B. Moss. Protection traps and alternatives for memory management of an object-oriented language. In Proceedings of the Fourteenth ACM Symposium on Operating Systems Principles, pages 106--119, Asheville, North Carolina, Dec. 1993. doi: 10. 1145/168619.168628. Google Scholar
Digital Library
- A. L. Hosking, J. E. B. Moss, and D. Stefanović. A comparative performance evaluation of write barrier implementations. In ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 92--109, Vancouver, Canada, Oct. 1992. doi: 10.1145/141936.141946. Google Scholar
Digital Library
- P. Sobalvarro. A lifetime-based garbage collector for Lisp systems on general-purpose computers. Technical Report AITR-1417, MIT AI Lab, Feb. 1988. Bachelor's thesis. Google Scholar
Digital Library
- SPEC. SPECjvm98, Release 1.03. Standard Performance Evaluation Corporation, Mar. 1999. URL http://www.spec.org/jvm98.Google Scholar
- SPEC. SPECjbb2005 (Java Server Benchmark), Release 1.07. Standard Performance Evaluation Corporation, 2006. URL http://www.spec.org/jbb2005.Google Scholar
- D. M. Ungar. Generation scavenging: A non-disruptive high performance storage reclamation algorithm. In ACM Software Engineering Symposium on Practical Software Development Environments, pages 157--167, Apr. 1984. doi: 10.1145/800020.808261. Google Scholar
Digital Library
- P. R. Wilson and T. G. Moher. A card-marking scheme for controlling intergenerational references in generation-based garbage collection on stock hardware. ACM SIGPLAN Notices, 24(5):87--92, May 1989. doi: 10.1145/66068.66077. Google Scholar
Digital Library
- B. Zorn. Barrier methods for garbage collection. Technical Report CU-CS-494-90, University of Colorado, Boulder, Nov. 1990.Google Scholar
Index Terms
Barriers reconsidered, friendlier still!
Recommendations
Barriers: friend or foe?
ISMM '04: Proceedings of the 4th international symposium on Memory managementModern 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 ...
Barriers reconsidered, friendlier still!
ISMM '12: Proceedings of the 2012 international symposium on Memory ManagementRead 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 ...







Comments