Abstract
Constructing a high-performance garbage collector is hard. Constructing a fully concurrent ‘on-the-fly’ compacting collector is much more so. We describe our experience of implementing the Sapphire algorithm as the first on-the-fly, parallel, replication copying, garbage collector for the Jikes RVM Java virtual machine (JVM). In part, we explain our innovations such as copying with hardware and software transactions, on-the-fly management of Java’s reference types, and simple, yet correct, lock-free management of volatile fields in a replicating collector. We fully evaluate, for the first time, and using realistic benchmarks, Sapphire’s performance and suitability as a low latency collector. An important contribution of this work is a detailed description of our experience of building an on-the-fly copying collector for a complete JVM with some assurance that it is correct. A key aspect of this is model checking of critical components of this complicated and highly concurrent system.
- Ali-Reza Adl-Tabatabai, Christos Kozyrakis, and Bratin Saha. 2009. Optimizing memory transactions for multicore systems. In Multicore Processors and Systems, Springer, Chapter 5, 145--172.Google Scholar
- Bowen Alpern, Maria Butrico, Anthony Cocchi, Julian Dolby, Stephen Fink, David Grove, and Ton Ngo. 2002. Experiences porting the Jikes RVM to Linux/IA32. In Java Virtual Machine Research and Technology Symposium. USENIX, 51--64. Google Scholar
Digital Library
- Austin Armbruster, Jason Baker, Antonio Cunei, Chapman Flack, David Holmes, Filip Pizlo, Edward Pla, Marek Prochazka, and Jan Vitek. 2007. A real-time Java virtual machine with applications in avionics. ACM Trans. Embed. Comput. Syst. 7, 1, Article 5 (2007). Supersedes (Baker et al. 2006). Google Scholar
Digital Library
- Matthew Arnold and Barbara G. Ryder. 2001. A framework for reducing the cost of instrumented code, see PLDI 2001 (2001), 168--179. Google Scholar
Digital Library
- Joshua Auerbach, David F. Bacon, Perry Cheng, David Grove, Ben Biron, Charlie Gracie, Bill McCloskey, Aleksandar Micic, and Ryan Sciampacone. 2008. Tax-and-spend: Democratic scheduling for real-time garbage collection. In Proceedings of the ACM International Conference on Embedded Software. ACM Press, 245--254. Google Scholar
Digital Library
- Azul. 2010. Comparison of Virtual Memory Manipulation Metrics. White paper. Azul Systems Inc. Retrieved from http://www.managedruntime.org/files/downloads/AzulVmemMetricsMRI.pdf.Google Scholar
- David F. Bacon, Perry Cheng, and V. T. Rajan. 2003. A real-time garbage collector with low overhead and consistent utilization. In Proceedings of the ACM SIGPLAN Symposium on Principles of Programming Languages. ACM Press, 285--298. Google Scholar
Digital Library
- David F. Bacon, Perry Cheng, and Sunil Shukla. 2012. And then there were none: A stall-free real-time garbage collector for reconfigurable hardware. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, 23--34. Google Scholar
Digital Library
- David F. Bacon, Perry Cheng, and Sunil Shukla. 2014. Parallel real-time garbage collection of multiple heaps in reconfigurable hardware, see Guyer and Grove (2014), 117--127. Google Scholar
Digital Library
- David F. Bacon, Ravi Konuru, Chet Murthy, and Mauricio Serrano. 1998. Thin locks: Featherweight synchronization for Java. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, 258--268. Google Scholar
Digital Library
- Henry G. Baker. 1978. List processing in real-time on a serial computer. Commun. ACM 21, 4 (1978), 280--294. Google Scholar
Digital Library
- Henry G. Baker. 1992. The Treadmill, real-time garbage collection without motion sickness. ACM SIGPLAN Not. 27, 3 (Mar. 1992), 66--70. Google Scholar
Digital Library
- Jason Baker, Antonio Cunei, Chapman Flack, Filip Pizlo, Marek Prochazka, Jan Vitek, Austin Armbruster, Edward Pla, and David Holmes. 2006. A real-time Java virtual machine for avionics—An experience report. In Proceedings of the IEEE Real-Time and Embedded Technology and Applications Symposium. 384--396. Google Scholar
Digital Library
- Edd Barrett, Carl Friedrich Bolz-Tereick, Rebecca Killick, Sarah Mount, and Laurence Tratt. 2017. Virtual machine warmup blows hot and cold. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications. ACM Press, 52:1--52:27. Google Scholar
Digital Library
- Yves Bekkers and Jacques Cohen (Eds.). 1992. Proceedings of the International Workshop on Memory Management. Lecture Notes in Computer Science, Vol. 637. Springer, St Malo, France. Google Scholar
Digital Library
- Mordechai Ben-Ari. 1984. Algorithms for on-the-fly garbage collection. ACM Trans. Program. Lang. Syst. 6, 3 (Jul. 1984), 333--344. Google Scholar
Digital Library
- Stephen M. Blackburn, Perry Cheng, and Kathryn S. McKinley. 2004. Oil and water? High performance garbage collection in Java with MMTk. In Proceedings of the International Conference on Software Engineering. IEEE Computer Society Press, Los Alamitos, CA, 137--146. Google Scholar
Digital Library
- Stephen M. Blackburn, Robin Garner, Chriss Hoffman, Asjad M. Khan, Kathryn S. McKinley, Rotem Bentzur, Amer Diwan, Daniel Feinberg, Daniel Frampton, Samuel Z. Guyer, Martin Hirzel, Antony Hosking, Maria Jump, Han Lee, J. Eliot B. Moss, Aashish Phansalkar, Darko Stefanović, Thomas VanDrunen, Daniel von Dincklage, and Ben Wiedermann. 2006. The DaCapo benchmarks: Java benchmarking development and analysis. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications. ACM Press, New York, NY, 169--190. Google Scholar
Digital Library
- Stephen M. Blackburn and Kathryn S. McKinley. 2002. In or out? Putting write barriers in their place. In Proceedings of the ACM SIGPLAN International Symposium on Memory Management. ACM Press, New York, NY, 175--184. Google Scholar
Digital Library
- Hans Boehm and David Bacon (Eds.). 2011. Proceedings of the ACM SIGPLAN International Symposium on Memory Management. ACM Press, New York, NY.Google Scholar
- Hans-Juergen Boehm and Sarita V. Adve. 2008. Foundations of the C++ concurrency memory model, see Gupta and Amarasinghe (2008), 68--78. Google Scholar
Digital Library
- Rodney A. Brooks. 1984. 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. ACM Press, New York, NY, 256--262. Google Scholar
Digital Library
- Perry Cheng and Guy Blelloch. 2001. A parallel, real-time garbage collector, see PLDI 2001 (2001), 125--136. Google Scholar
Digital Library
- Michal Cierniak, Marsha Eng, Neal Glew, Brian Lewis, and James Stichnoth. 2005. The Open Runtime Platform: A flexible high-performance managed runtime environment. Concurr. Comput. Pract. Exp. 17, 5--6 (2005), 617--637. Google Scholar
Digital Library
- Cliff Click, Gil Tene, and Michael Wolf. 2005. The Pauseless GC algorithm. In Proceedings of the ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments. ACM Press, New York, NY, 46--56. Google Scholar
Digital Library
- David Detlefs, Christine Flood, Steven Heller, and Tony Printezis. 2004. Garbage-First garbage collection. In Proceedings of the ACM SIGPLAN International Symposium on Memory Management. ACM Press, New York, NY, 37--48. Google Scholar
Digital Library
- Sylvia Dieckmann and Urs Hölzle. 1999. A study of the allocation behavior of the SPECjvm98 Java benchmarks. In Proceedings of the European Conference on Object-Oriented Programming. Lecture Notes in Computer Science, Vol. 1628. Springer-Verlag, Lisbon, Portugal, 92--115. Google Scholar
Digital Library
- Edsger W. Dijkstra, Leslie Lamport, A. J. Martin, C. S. Scholten, and E. F. M. Steffens. 1978. On-the-fly garbage collection: An exercise in cooperation. Commun. ACM 21, 11 (Nov. 1978), 965--975. Google Scholar
Digital Library
- Damien Doligez and Georges Gonthier. 1994. Portable, unobtrusive garbage collection for multiprocessor systems. In Proceedings of the ACM SIGPLAN Symposium on Principles of Programming Languages. ACM Press, New York, NY, 70--83. Google Scholar
Digital Library
- Damien Doligez and Xavier Leroy. 1993. A concurrent generational garbage collector for a multi-threaded implementation of ML. In Proceedings of the ACM SIGPLAN Symposium on Principles of Programming Languages. ACM Press, New York, NY, 113--123. Google Scholar
Digital Library
- Tamar Domani, Elliot K. Kolodner, and Erez Petrank. 2000. A generational on-the-fly garbage collector for Java. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, New York, NY, 274--284. Google Scholar
Digital Library
- Robin J. Garner, Stephen M. Blackburn, and Daniel Frampton. 2011. A comprehensive evaluation of object scanning techniques, see Boehm and Bacon (2011), 33--42. Google Scholar
Digital Library
- Andy Georges, Lieven Eeckhout, and Dries Buytaert. 2008. Java performance evaluation through rigorous replay compilation. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications. ACM Press, New York, NY, 367--384. Google Scholar
Digital Library
- James Gosling, Bill Joy, Guy Steele, Gilad Bracha, and Alex Buckley. 2015. The Java Language Specification (Java SE 8 ed.). Addison Wesley. https://docs.oracle.com/javase/specs/jls/se8/jls8.pdf. Google Scholar
Digital Library
- Rajiv Gupta and Saman P. Amarasinghe (Eds.). 2008. Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, New York, NY.Google Scholar
- Samuel Z. Guyer and David Grove (Eds.). 2014. Proceedings of the ACM SIGPLAN International Symposium on Memory Management. ACM Press, New York NY.Google Scholar
- Roger Henriksson. 1998. Scheduling Garbage Collection in Embedded Systems. Ph.D. Dissertation. Lund Institute of Technology.Google Scholar
- Maurice Herlihy and Nir Shavit. 2008. The Art of Multiprocessor Programming. Morgan Kaufman. Google Scholar
Digital Library
- Maurice P. Herlihy and J. Eliot B. Moss. 1993. Transactional memory: Architectural support for lock-free data structures. In Proceedings of the ACM/IEEE International Symposium on Computer Architecture. IEEE Press, Los Alamitos, CA, 289--300. Google Scholar
Digital Library
- G. J. Holzmann. 2004. The SPIN Model Checker: Primer and Reference Manual. Addison-Wesley. Google Scholar
Digital Library
- Shin Hong and Moonzoo Kim. 2015. A survey of race bug detection techniques for multithreaded programmes. Softw. Test. Verif. Reliabil. 25, 3 (May 2015), 191--217. Google Scholar
Digital Library
- Richard L. Hudson and J. Eliot B. Moss. 1992. Incremental collection of mature objects, see Bekkers and Cohen (1992), 388--403. Google Scholar
Digital Library
- Richard L. Hudson and J. Eliot B. Moss. 2001. Sapphire: Copying GC without stopping the world. In Proceedings of the Joint ACM-ISCOPE Java Grande Conference. ACM Press, New York, NY, 48--57. Google Scholar
Digital Library
- Richard L. Hudson and J. Eliot B. Moss. 2003. Sapphire: Copying garbage collection without stopping the world. Concurr. Comput.: Pract. Exp. 15, 3--5 (2003), 223--261.Google Scholar
Cross Ref
- R. John M. Hughes. 1982. A semi-incremental garbage collection algorithm. Softw. Pract. Exp. 12, 11 (Nov. 1982), 1081--1082.Google Scholar
Cross Ref
- Intel. 2013. Intel 64 and IA-32 Architectures Software Developer’s Manual.Google Scholar
- Balaji Iyengar, Gil Tene, Michael Wolf, and Edward Gehringer. 2012. The Collie: A wait-free compacting collector, see McKinley and Vechev (2012), 85--96. Google Scholar
Digital Library
- Nicholas Jacek, Meng-Chieh Chiu, Benjamin Marlin, and Eliot Moss. 2016. Assessing the limits of program-specific garbage collection performance. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, New York, NY, 584--598. Google Scholar
Digital Library
- Richard Jones, Antony Hosking, and Eliot Moss. 2012. The Garbage Collection Handbook: The Art of Automatic Memory Management. Chapman 8 Hall. Google Scholar
Digital Library
- Richard Jones. 1996. Garbage Collection: Algorithms for Automatic Dynamic Memory Management. Wiley, Chichester. Google Scholar
Digital Library
- Richard Jones and Andy C. King. 2005. A fast analysis for thread-local garbage collection with dynamic class loading. In Proceedings of the IEEE International Workshop on Source Code Analysis and Manipulation. IEEE Computer Society Press, Los Alamitos, CA, 129--138. Google Scholar
Digital Library
- Tomas Kalibera. 2009. Replicating real-time garbage collector for Java. In Proceedings of the International Workshop on Java Technologies for Real-time and Embedded Systems. ACM Press, Los Alamitos, CA, 100--109. Google Scholar
Digital Library
- Tomas Kalibera and Richard Jones. 2011. Handles revisited: Optimising performance and memory costs in a real-time collector, see Boehm and Bacon (2011), 89--98. Google Scholar
Digital Library
- Tomas Kalibera and Richard Jones. 2013. Rigorous benchmarking in reasonable time. In Proceedings of the ACM SIGPLAN International Symposium on Memory Management. ACM Press, Los Alamitos, CA, 63--74. Google Scholar
Digital Library
- Tomas Kalibera, Matthew Mole, Richard Jones, and Jan Vitek. 2012. A black-box approach to understanding concurrency in DaCapo. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications. ACM Press, Los Alamitos, CA, 335--354. DOI:http://www.cs.kent.ac.uk/pubs/2012/3246 Google Scholar
Digital Library
- Tomas Kalibera, Filip Pizlo, Antony L. Hosking, and Jan Vitek. 2009. Scheduling hard real-time garbage collection. In Proceedings of the IEEE Real-Time Systems Symposium. IEEE Computer Society Press, Los Alamitos, CA, 81--92. Google Scholar
Digital Library
- Tomas Kalibera, Filip Pizlo, Antony L. Hosking, and Jan Vitek. 2011. Scheduling real-time garbage collection on uniprocessors. ACM Trans. Comput. Syst. 3, 1 (Aug. 2011), 8:1--29. Google Scholar
Digital Library
- Haim Kermany and Erez Petrank. 2006. The Compressor: Concurrent, incremental and parallel compaction. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, New York, NY, 354--363. Google Scholar
Digital Library
- Bill McCloskey, David F. Bacon, Perry Cheng, and David Grove. 2008. Staccato: A Parallel and Concurrent Real-time Compacting Garbage Collector for Multiprocessors. IBM Research Report RC24505. IBM Research.Google Scholar
- Phil McGachey, Ali-Reza Adl-Tabatabi, Richard L. Hudson, Vijay Menon, Bratin Saha, and Tatiana Shpeisman. 2008. Concurrent GC leveraging transactional memory. In Proceedings of the ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming. ACM Press, Los Alamitos, CA, 217--226. Google Scholar
Digital Library
- Kathryn McKinley and Martin Vechev (Eds.). 2012. Proceedings of the ACM SIGPLAN International Symposium on Memory Management. ACM Press, Los Alamitos, CA.Google Scholar
- Scott Nettles and James O’Toole. 1993. Real-time replication-based garbage collection. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, Los Alamitos, CA, 217--226. Google Scholar
Digital Library
- Scott M. Nettles, James W. O’Toole, David Pierce, and Nicholas Haines. 1992. Replication-based incremental copying collection, see Bekkers and Cohen (1992), 357--364. Google Scholar
Digital Library
- Oracle JNI. 2015. Java Native Interface 6.0 API Specification. Retrieved from http://docs.oracle.com/javase/8/docs/technotes/guides/jni/.Google Scholar
- Pekka P. Pirinen. 1998. Barrier techniques for incremental tracing. In Proceedings of the ACM SIGPLAN International Symposium on Memory Management. ACM Press, Los Alamitos, CA, 20--25. Google Scholar
Digital Library
- Filip Pizlo, Daniel Frampton, and Antony L. Hosking. 2011. Fine-grained adaptive biased locking. In Proceedings of the International Conference on Principles and Practice of Programming in Java. ACM Press, 171--181. Google Scholar
Digital Library
- Filip Pizlo, Daniel Frampton, Erez Petrank, and Bjarne Steensgard. 2007a. Stopless: A real-time garbage collector for multiprocessors. In Proceedings of the ACM SIGPLAN International Symposium on Memory Management. ACM Press, Los Alamitors, CA, 159--172. Google Scholar
Digital Library
- Filip Pizlo, Antony L. Hosking, and Jan Vitek. 2007b. Hierarchical real-time garbage collection. In Proceedings of the ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools for Embedded Systems. 123--133. Google Scholar
Digital Library
- Filip Pizlo, Erez Petrank, and Bjarne Steensgaard. 2008a. Path specialization: Reducing phased execution overheads. In Proceedings of the ACM SIGPLAN International Symposium on Memory Management. ACM Press, Los Alamitos, CA, 81--90. Google Scholar
Digital Library
- Filip Pizlo, Erez Petrank, and Bjarne Steensgaard. 2008b. A study of concurrent real-time garbage collectors, see Gupta and Amarasinghe (2008), 33--44. Google Scholar
Digital Library
- Filip Pizlo, Lukasz Ziarek, Petr Maj, Antony L. Hosking, Ethan Blanton, and Jan Vitek. 2010. Schism: Fragmentation-tolerant real-time garbage collection. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, Los Alamitos, CA, 146--159. Google Scholar
Digital Library
- PLDI 2001 2001. Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, Los Alamitos, CA.Google Scholar
- Tony Printezis. 2006. On measuring garbage collection responsiveness. Sci. Comput. Program. 62, 2 (Oct. 2006), 164--183. Google Scholar
Digital Library
- Wolfgang Puffitsch. 2011. Hard real-time garbage collection for a Java chip multi-processor. In Proceedings of the International Workshop on Java Technologies for Real-time and Embedded Systems. ACM Press, New York, NY, 64--73. Google Scholar
Digital Library
- Wolfgang Puffitsch. 2013. Design and analysis of a hard real-time garbage collector for a Java chip multi-processor. Concurr. Comput. Pract. Exp. 25, 16 (2013), 2269--2289.Google Scholar
Cross Ref
- Carl G. Ritson and Frederick R. M. Barnes. 2013. An evaluation of Intel's Restricted Transactional Memory for CPAs. In Communicating Process Architectures. Open Channel Publishing Ltd, 271--291.Google Scholar
- Carl G. Ritson, Tomoharu Ugawa, and Richard Jones. 2014. Exploring garbage collection with Haswell hardware transactional memory, see Guyer and Grove (2014), 105--115. Google Scholar
Digital Library
- Hideaki Saiki, Yoshiharu Konaka, Tsuneyasu Komiya, Masahiro Yasugi, and Taiichi Yuasa. 2005. Real-time GC in JeRTy™VM using the return-barrier method. In Proceedings of the IEEE International Symposium on Object-oriented Real-time Distributed Computing (ISORC’05). IEEE, 140--148. Google Scholar
Digital Library
- Gil Tene, Balaji Iyengar, and Michael Wolf. 2011. C4: The continuously concurrent compacting collector, see Boehm and Bacon (2011), 79--88. Google Scholar
Digital Library
- Tomoharu Ugawa, Richard Jones, and Carl G. Ritson. 2014. Reference object processing in on-the-fly garbage collection, see Guyer and Grove (2014), 59--69. Google Scholar
Digital Library
- Jan Vitek and Tomas Kalibera. 2011. Repeatability, reproducibility, and rigor in systems research. In Proceedings of the ACM International Conference on Embedded Software. ACM Press, New York, NY, 33--38. Google Scholar
Digital Library
- Paul R. Wilson. 1994. Uniprocessor Garbage Collection Techniques. Technical Report. University of Texas.Google Scholar
- Xi Yang, Stephen M. Blackburn, Daniel Frampton, and Antony L. Hosking. 2012. Barriers reconsidered, friendlier still!, see McKinley and Vechev (2012), 37--48. Google Scholar
Digital Library
- Yuan Yu, Tom Rodeheffer, and Wei Chen. 2005. Racetrack: Efficient detection of data race conditions via adaptive tracking. In Proceedings of the Symposium on Operating Systems Principles. ACM Press, 221--234. Google Scholar
Digital Library
Index Terms
Transactional Sapphire: Lessons in High-Performance, On-the-fly Garbage Collection
Recommendations
Reducing pause time of conservative collectors
MSP 2002 and ISMM 2002This paper describes an incremental conservative garbage collector that significantly reduces pause time of an existing collector by Boehm et al. Like their collector, it is a true conservative collector that does not require compiler cooperation but ...
Reducing pause time of conservative collectors
ISMM '02: Proceedings of the 3rd international symposium on Memory managementThis paper describes an incremental conservative garbage collector that significantly reduces pause time of an existing collector by Boehm et al. Like their collector, it is a true conservative collector that does not require compiler cooperation but ...
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