ABSTRACT
Jonkers's threaded compaction is attractive in the context of memory-constrained embedded systems because of its space efficiency. However, it cannot be applied to a heap where ordinary objects and meta-objects are intermingled for the following reason. It requires the object layout information, which is often stored in meta-objects, to update pointer fields inside objects correctly. Because Jonkers's threaded compaction reverses pointer directions during garbage collection (GC), it cannot follow the pointers to obtain the object layout. This paper proposes Fusuma, a double-ended threaded compaction that allows ordinary objects and meta-objects to be allocated in the same heap. Its key idea is to segregate ordinary objects at one end of the monolithic heap and meta-objects at the other to make it possible to separate the phases of threading pointers in ordinary objects and meta-objects. Much like Jonkers's threaded compaction, Fusuma does not require any additional space for each object. We implemented it in eJSVM, a JavaScript virtual machine for embedded systems, and compared its performance with eJSVM using mark-sweep GC. As a result, compaction enabled an IoT-oriented benchmark program to run in a 28-KiB heap, which is 20 KiB smaller than mark-sweep GC. We also confirmed that the GC overhead of Fusuma was less than 2.50x that of mark-sweep GC.
- Bowen Alpern, Steve Augart, Stephen M. Blackburn, Maria A. Butrico, Anthony Cocchi, Perry Cheng, Julian Dolby, Stephen J. Fink, David Grove, Michael Hind, Kathryn S. McKinley, Mark F. Mergen, J. Eliot B. Moss, Ton Anh Ngo, Vivek Sarkar, and Martin Trapp. 2005. The Jikes Research Virtual Machine project: Building an open-source research community. IBM Syst. J., 44, 2 (2005), 399–418. https://doi.org/10.1147/sj.442.0399 Google ScholarDigital Library
- David F. Bacon, Perry Cheng, and V. T. Rajan. 2003. Controlling fragmentation and space consumption in the metronome, a real-time garbage collector for Java. In Proceedings of the 2003 Conference on Languages, Compilers, and Tools for Embedded Systems (LCTES 2003). ACM, 81–92. https://doi.org/10.1145/780732.780744 Google ScholarDigital Library
- Stephen M. Blackburn, Perry Cheng, and Kathryn S. McKinley. 2004. Oil and Water? High Performance Garbage Collection in Java with MMTk. In 26th International Conference on Software Engineering (ICSE 2004). IEEE Computer Society, 137–146. https://doi.org/10.1109/ICSE.2004.1317436 Google ScholarCross Ref
- Craig Chambers, David M. Ungar, and Elgin Lee. 1989. An Efficient Implementation of SELF – a Dynamically-Typed Object-Oriented Language Based on Prototypes. In Conference Proceedings on Object-Oriented Programming: Systems, Languages, and Applications (OOPSLA 1989). ACM, 49–70. https://doi.org/10.1145/74877.74884 Google ScholarDigital Library
- Chris J. Cheney. 1970. A Nonrecursive List Compacting Algorithm. Commun. ACM, 13, 11 (1970), 677–678. https://doi.org/10.1145/362790.362798 Google ScholarDigital Library
- Daniel Clifford, Hannes Payer, Michael Stanton, and Ben L. Titzer. 2015. Memento mori: dynamic allocation-site-based optimizations. In Proceedings of the 2015 ACM SIGPLAN International Symposium on Memory Management (ISMM 2015). ACM, 105–117. https://doi.org/10.1145/2754169.2754181 Google ScholarDigital Library
- Ulan Degenbaev, Michael Lippautz, and Hannes Payer. 2019. Concurrent marking of shape-changing objects. In Proceedings of the 2019 ACM SIGPLAN International Symposium on Memory Management (ISMM 2019). ACM, 89–102. https://doi.org/10.1145/3315573.3329978 Google ScholarDigital Library
- David Detlefs, Christine H. Flood, Steve Heller, and Tony Printezis. 2004. Garbage-first garbage collection. In Proceedings of the 4th International Symposium on Memory Management (ISMM 2004). ACM, 37–48. https://doi.org/10.1145/1029873.1029879 Google ScholarDigital Library
- L. Peter Deutsch and Allan M. Schiffman. 1984. Efficient Implementation of the Smalltalk-80 System. In Proceedings of the 11th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL 1984). ACM, 297–302. https://doi.org/10.1145/800017.800542 Google ScholarDigital Library
- Bruce K. Haddon and William M. Waite. 1967. A Compaction Procedure for Variable-Length Storage Elements. Comput. J., 10, 2 (1967), 162–165. https://doi.org/10.1093/comjnl/10.2.162 Google ScholarCross Ref
- Urs Hölzle, Craig Chambers, and David M. Ungar. 1991. Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches. In ECOOP’91 European Conference on Object-Oriented Programming (Lecture Notes in Computer Science, Vol. 512). Springer, 21–38. https://doi.org/10.1007/BFb0057013 Google ScholarCross Ref
- H. B. M. Jonkers. 1979. A Fast Garbage Compaction Algorithm. Inf. Process. Lett., 9, 1 (1979), 26–30. https://doi.org/10.1016/0020-0190(79)90103-0 Google ScholarCross Ref
- Haim Kermany and Erez Petrank. 2006. The Compressor: concurrent, incremental, and parallel compaction. In Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2006). ACM, 354–363. https://doi.org/10.1145/1133981.1134023 Google ScholarDigital Library
- Donald Ervin Knuth. 1997. The art of computer programming, Volume I: Fundamental Algorithms, 3rd Edition. Addison-Wesley. isbn:0201896834 https://www.worldcat.org/oclc/312910844Google Scholar
- Bernard Lang and Francis Dupont. 1987. Incremental incrementally compacting garbage collection. In Proceedings of the Symposium on Interpreters and Interpretive Techniques. ACM, 253–263. https://doi.org/10.1145/29650.29677 Google ScholarDigital Library
- Stefan Marr, Benoit Daloze, and Hanspeter Mössenböck. 2016. Cross-Language Compiler Benchmarking—Are We Fast Yet? In Proceedings of the 12th Symposium on Dynamic Languages (DLS 2016). ACM, 120–131. isbn:978-1-4503-4445-6 https://doi.org/10.1145/2989225.2989232 Google ScholarDigital Library
- Hiro Onozawa, Hideya Iwasaki, and Tomoharu Ugawa. 2021. Customizing JavaScript Virtual Machines for Specific Applications and Execution Environments. Computer Software, 38, 3 (2021), to appear (in Japanese).Google Scholar
- Hiro Onozawa, Tomoharu Ugawa, and Hideya Iwasaki. 2021. Fusuma: Double-Ended Threaded Compaction (Full Version). https://ipl.cs.uec.ac.jp/~iwasaki/eJS/technical-report/Fusuma.pdfGoogle Scholar
- Tony Printezis. 2001. Hot-Swapping Between a Mark&Sweep and a Mark&Compact Garbage Collector in a Generational Environment. In Proceedings of the 1st Java Virtual Machine Research and Technology Symposium. USENIX. http://www.usenix.org/publications/library/proceedings/jvm01/printezis.htmlGoogle Scholar
- Tomoharu Ugawa, Hideya Iwasaki, and Takafumi Kataoka. 2019. eJSTK: Building JavaScript virtual machines with customized datatypes for embedded systems. J. Comput. Lang., 51 (2019), 261–279. https://doi.org/10.1016/j.cola.2019.01.003 Google ScholarCross Ref
- Tomoharu Ugawa, Carl G. Ritson, and Richard E. Jones. 2018. Transactional Sapphire: Lessons in High-Performance, On-the-fly Garbage Collection. ACM Trans. Program. Lang. Syst., 40, 4 (2018), 15:1–15:56. https://doi.org/10.1145/3226225 Google ScholarDigital Library
Index Terms
Fusuma: double-ended threaded compaction
Recommendations
Improved replication-based incremental garbage collection for embedded systems
ISMM '10We have developed an incremental compacting garbage collector for embedded Java systems. The collector divides the heap into equal sized pages and uses the segregated free lists for fast allocation. Collectors that have such a heap layout have a problem ...
Mostly concurrent compaction for mark-sweep GC
ISMM '04: Proceedings of the 4th international symposium on Memory managementA memory manager that does not move objects may suffer from memory <i>fragmentation</i>. <i>Compaction</i> is an efficient, and sometimes inevitable, mechanism for reducing fragmentation. A Mark-Sweep garbage collector must occasionally execute a ...
Improved replication-based incremental garbage collection for embedded systems
ISMM '10: Proceedings of the 2010 international symposium on Memory managementWe have developed an incremental compacting garbage collector for embedded Java systems. The collector divides the heap into equal sized pages and uses the segregated free lists for fast allocation. Collectors that have such a heap layout have a problem ...
Comments