skip to main content
research-article

Integrated Hardware Garbage Collection

Published: 09 July 2021 Publication History

Abstract

Garbage collected programming languages, such as Python and C#, have accelerated software development. These modern languages increase productivity and software reliability as they provide high-level data representation and control structures. Modern languages are widely used in software development for mobile, desktop, and server devices, but their adoption is limited in real-time embedded systems.
There is clear interest in supporting modern languages in embedded devices as emerging markets, like the Internet of Things, demand ever smarter and more reliable products. Multiple commercial and open-source projects, such as Zerynth and MicroPython, are attempting to provide support. But these projects rely on software garbage collectors that impose high overheads and introduce unpredictable pauses, preventing their use in many embedded applications. These limitations arise from the unsuitability of conventional processors for performing efficient, predictable garbage collection.
We propose the Integrated Hardware Garbage Collector (IHGC); a garbage collector tightly coupled with the processor that runs continuously in the background. Further, we introduce a static analysis technique to guarantee that real-time programs are never paused by the collector. Our design allocates a memory cycle to the collector when the processor is not using the memory. The IHGC achieves this by careful division of collection work into single-memory-access steps that are interleaved with the processor’s memory accesses. As a result, our collector eliminates run-time overheads and enables real-time program analysis.
The principles behind the IHGC can be used in conjunction with existing architectures. For example, we simulated the IHGC alongside the ARMv6-M architecture. Compared to a conventional processor, our experiments indicate that the IHGC offers 1.5–7 times better performance for programs that rely on garbage collection. The IHGC delivers the benefits of garbage-collected languages with real-time performance but without the complexity and overheads inherent in software collectors.

References

[1]
Arm Limited. 2009. Cortex-M0 Technical Reference Manual. Retrieved from https://developer.arm.com/documentation/ddi0432/latest/.
[2]
Arm Limited. 2019. Mbed TLS. Retrieved from https://github.com/ARMmbed/mbedtls.
[3]
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. ACM SIGPLAN Not. 38, 7 (2003), 81–92.
[4]
David F. Bacon, Perry Cheng, and V. T. Rajan. 2003. A real-time garbage collector with low overhead and consistent utilization. ACM SIGPLAN Not. 38, 1 (2003), 285–298.
[5]
Michel Berkelaar, Kjell Eikland, and Peter Notebaert. 2005. lp_solve version 5.5–open source (mixed-integer) linear programming system.
[6]
Nathan Binkert, Bradford Beckmann, Gabriel Black, Steven K. Reinhardt, Ali Saidi, Arkaprava Basu, Joel Hestness, Derek R. Hower, Tushar Krishna, Somayeh Sardashti et al. 2011. The gem5 simulator. ACM SIGARCH Comput. Archit. News 39, 2 (2011), 1–7. Retrieved from http://lpsolve.sourceforge.net/5.5/.
[7]
Robert Bosch and Michael Trick. 2005. Integer programming. In Search Methodologies. Springer.
[8]
Ting Cao, Stephen M. Blackburn, Tiejun Gao, and Kathryn S. McKinley. 2012. The yin and yang of power and performance for asymmetric hardware and managed software. In ACM SIGARCH Computer Architecture News, Vol. 40. IEEE Computer Society, 225–236.
[9]
Trevor E. Carlson, Wim Heirman, and Lieven Eeckhout. 2011. Sniper: Exploring the level of abstraction for scalable and accurate parallel multi-core simulation. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis. 1–12.
[10]
Stephen Cass. 2019. The Top Programming Languages 2019. Retrieved from https://spectrum.ieee.org/computing/ software/the-top-programming-languages-2019.
[11]
Yang Chang. 2007. Garbage Collection for Flexible Hard Real-time Systems. Ph.D. Dissertation. University of York.
[12]
Perry Cheng and Guy E. Blelloch. 2001. A parallel, real-time garbage collector. ACM SIGPLAN Not. 36, 5 (2001), 125–136.
[13]
Cliff Click, Gil Tene, and Michael Wolf. 2005. The pauseless GC algorithm. In Proceedings of the 1st ACM/USENIX International Conference on Virtual Execution Environments. ACM, 46–56.
[14]
David Detlefs. 2004. A hard look at hard real-time garbage collection. In Proceedings of the 7th IEEE International Symposium on Object-oriented Real-time Distributed Computing. IEEE, 23–32.
[15]
Adam Dunkels and lwIP developers. 2019. lightweight IP. Retrieved from https://savannah.nongnu.org/projects/ lwip/.
[16]
Heiko Falk, Sebastian Altmeyer, Peter Hellinckx, Björn Lisper, Wolfgang Puffitsch, Christine Rochange, Martin Schoeberl, Rasmus Bo Sørensen, Peter Wägemann, and Simon Wegener. 2016. TACLeBench: A benchmark collection to support worst-case execution time research. In Proceedings of the 16th International Workshop on Worst-case Execution Time Analysis (WCET 2016) (OpenAccess Series in Informatics (OASIcs)), Martin Schoeberl (Ed.), Vol. 55. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, Dagstuhl, Germany, 2:1–2:10.
[17]
Alex Gaynor, Alexandre Vassalotti, Antoine Pitrou, Anuj Gupta, Benjamin Peterson, Bobby Impollonia, Brett Cannon, Collin Winter, David Laing, David Malcolm, Dmitry Jemerov, Florin Papa, Georg Brandl, James Abbatiello, Jeffrey Yasskin, Maciej Fijalkowski, Reid Klecker, Skip Montanaro, Stefan Behnel, Thomas Wouters, Victor Stinner, and Zachary Ware. 2018. The Python Benchmark Suite. Retrieved from https://github.com/python/performance.
[18]
Ionel Gog, Jana Giceva, Malte Schwarzkopf, Kapil Vaswani, Dimitrios Vytiniotis, Ganesan Ramalingam, Manuel Costa, Derek G. Murray, Steven Hand, and Michael Isard. 2015. Broom: Sweeping out garbage collection from big data systems. In Proceedings of the 15th Workshop on Hot Topics in Operating Systems (HotOS’15).
[19]
Neville Grech, Kyriakos Georgiou, James Pallister, Steve Kerrison, Jeremy Morse, and Kerstin Eder. 2015. Static analysis of energy consumption for LLVM IR programs. In Proceedings of the 18th International Workshop on Software and Compilers for Embedded Systems. 12–21.
[20]
Dan Grossman, Greg Morrisett, Trevor Jim, Michael Hicks, Yanling Wang, and James Cheney. 2002. Region-based memory management in Cyclone. ACM Sigplan Not. 37, 5 (2002), 282–293.
[21]
Flavius Gruian and Zoran Salcic. 2005. Designing a concurrent hardware garbage collector for small embedded systems. In Proceedings of the Asia-Pacific Conference on Advances in Computer Systems Architecture. Springer, 281–294.
[22]
Jan Gustafsson, Adam Betts, Andreas Ermedahl, and Björn Lisper. 2010. The Mälardalen WCET benchmarks: Past, present and future. In Proceedings of the 10th International Workshop on Worst-case Execution Time Analysis (WCET’10). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik.
[23]
Matthew R. Guthaus, James E. Stine, Samira Ataei, Brian Chen, Bin Wu, and Mehedi Sarwar. 2016. OpenRAM: An open-source memory compiler. In Proceedings of the IEEE/ACM International Conference on Computer-aided Design (ICCAD’16). IEEE, 1–6.
[24]
Roger Henriksson. 1998. Scheduling Garbage Collection in Embedded Systems. Ph.D. Dissertation. Lund University.
[25]
JerryScript. 2019. A JavaScript Engine for Internet of Things. Retrieved from https://jerryscript.net/.
[26]
José A Joao, Onur Mutlu, and Yale N. Patt. 2009. Flexible reference-counting-based hardware acceleration for garbage collection. In Proceedings of the 36th International Symposium on Computer Architecture. 418–428.
[27]
Mark Stuart Johnstone and Paul R. Wilson. 1997. Non-compacting Memory Allocation and Real-time Garbage Collection. Ph.D. Dissertation. University of Texas at Austin.
[28]
Taehyoun Kim, Naehyuck Chang, and Heonshik Shin. 2001. Joint scheduling of garbage collector and hard real-time tasks for embedded applications. J. Syst. Softw. 58, 3 (2001), 247–260.
[29]
Gábor Kiss-Vámosi. 2019. LittlevGL. Retrieved from https://github.com/littlevgl/lvgl.
[30]
Albert Kwon, Udit Dhawan, Jonathan M. Smith, Thomas F. Knight Jr, and Andre DeHon. 2013. Low-fat pointers: Compact encoding and efficient gate-level implementation of fat pointers for spatial safety and capability-based security. In Proceedings of the ACM SIGSAC Conference on Computer & Communications Security. ACM, 721–732.
[31]
Doug Lea. 2000. A Memory Allocator. Retrieved from http://gee.cs.oswego.edu/dl/html/malloc.html.
[32]
Y.-T. S. Li, Sharad Malik, and Andrew Wolfe. 1995. Efficient microarchitecture modeling and path analysis for real-time software. In Proceedings of the 16th IEEE Real-time Systems Symposium. IEEE, 298–307.
[33]
Sung-Soo Lim. 2009. SNU Real-Time Benchmarks. Retrieved from http://www.cprover.org/goto-cc/examples/snu.html.
[34]
Douglass Locke, Andersen Scott, Ben Brosgol, Mike Fulton, Thomas Henties, James Hunt, Johan Nielsen, Kevin Nilsen, Anders Ravn, Martin Schoeberl, Jan Vitek, and Andy Wellings. 2018. Safety Critical Java Technology Specification: JSR-302 (Draft v0.114). Retrieved from https://jcp.org/en/jsr/detail?id=302.
[35]
Martin Maas, Krste Asanović, and John Kubiatowicz. 2018. A hardware accelerator for tracing garbage collection. In Proceedings of the ACM/IEEE 45th International Symposium on Computer Architecture (ISCA’18). IEEE, 138–151.
[36]
Tobias Mann, Morgan Deters, Rob LeGrand, and Ron K. Cytron. 2005. Static determination of allocation rates to support real-time garbage collection. ACM SIGPLAN Not. 40, 7 (2005), 193–202.
[37]
Matthias Meyer. 2005. An on-chip garbage collection coprocessor for embedded real-time systems. In Proceedings of the 11th IEEE International Conference on Embedded and Real-time Computing Systems and Applications. IEEE, 517–524.
[38]
Matthias Meyer. 2006. A true hardware read barrier. In Proceedings of the 5th International Symposium on Memory Management. ACM, 3–16.
[39]
micropython.org. 2018. The Micropython Project. Retrieved from https://github.com/micropython/micropython.
[40]
Santosh Nagarakatte, Jianzhou Zhao, Milo M. K. Martin, and Steve Zdancewic. 2009. SoftBound: Highly compatible and complete spatial memory safety for C. ACM Sigplan Not. 44, 6 (2009), 245–258.
[41]
Kelvin D. Nilsen. 1994. Reliable real-time garbage collection of C++. Comput. Syst. 7, 4 (1994), 467–504.
[42]
James Pallister, Simon Hollis, and Jeremy Bennett. 2013. BEEBS: Open benchmarks for energy measurements on embedded platforms. arXiv preprint arXiv:1308.5174 (2013).
[43]
Isabelle Puaut. 2002. Real-time performance of dynamic memory allocation algorithms. In Proceedings of the 14th Euromicro Conference on Real-time Systems. IEEE, 41–49.
[44]
Wolfgang Puffitsch, Benedikt Huber, and Martin Schoeberl. 2010. Worst-case analysis of heap allocations. In Proceedings of the International Symposium on Leveraging Applications of Formal Methods, Verification, and Validation. Springer, 464–478.
[45]
John Regehr, Nathan Cooprider, Will Archer, and Eric Eide. 2006. Efficient type and memory safety for tiny embedded systems. In Proceedings of the 3rd Workshop on Programming Languages and Operating Systems: Linguistic Support for Modern Operating Systems. ACM, 6.
[46]
Sven Gestegard Robertz and Roger Henriksson. 2003. Time-triggered garbage collection: Robust and adaptive real-time GC scheduling for embedded systems. In Proceedings of the ACM SIGPLAN Conference on Language, Compiler, and Tool for Embedded Systems. 93–102.
[47]
Daniel Sanchez and Christos Kozyrakis. 2013. ZSim: Fast and accurate microarchitectural simulation of thousand-core systems. ACM SIGARCH Comput. Archit. News 41, 3 (2013), 475–486.
[48]
William J. Schmidt and Kelvin D. Nilsen. 1994. Performance of a hardware-assisted real-time garbage collector. ACM SIGOPS Oper. Syst. Rev. 28, 5 (1994), 76–85.
[49]
Martin Schoeberl. 2006. Real-time garbage collection for Java. In Proceedings of the 9th IEEE International Symposium on Object and Component-oriented Real-time Distributed Computing (ISORC’06).
[50]
Martin Schoeberl, Thomas B. Preusser, and Sascha Uhrig. 2010. The embedded Java benchmark suite JemBench. In Proceedings of the 8th International Workshop on Java Technologies for Real-time and Embedded Systems. 120–127.
[51]
Martin Schoeberl and Wolfgang Puffitsch. 2008. Non-blocking object copy for real-time garbage collection. In Proceedings of the 6th International Workshop on Java Technologies for Real-time and Embedded Systems. 77–84.
[52]
Martin Schoeberl and Wolfgang Puffitsch. 2010. Nonblocking real-time garbage collection. ACM Trans. Embedd. Comput. Syst. 10, 1 (2010), 1–28.
[53]
Rifat Shahriyar, Stephen M. Blackburn, and Kathryn S. McKinley. 2014. Fast conservative garbage collection. In Proceedings of the ACM International Conference on Object-oriented Programming Systems Languages & Applications. 121–139.
[54]
Stack Overflow. 2019. Developer Survey Results 2019. Retrieved from https://insights.stackoverflow.com/survey/2019.
[55]
Sylvain Stanchina and Matthias Meyer. 2007. Mark-sweep or copying?: A best of both worlds algorithm and a hardware-supported real-time implementation. In Proceedings of the 6th International Symposium on Memory Management. ACM, 173–182.
[56]
STMicroelectronics. [n.d.]. STM32 32-bit ARM Cortex MCUs. Retrieved from https://www.st.com/en/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus.html.
[57]
Mark Sullivan and Ram Chillarege. 1991. Software defects and their impact on system availability-a study of field failures in operating systems. In Digest of Papers. Fault-tolerant Computing: The Twenty-first International Symposium. IEEE, 2–9.
[58]
Gavin Thomas. 2019. A proactive approach to more secure code. Retrieved from https://msrc-blog.microsoft.com/2019/07/16/a-proactive-approach-to-more-secure-code/.
[59]
Reinhard Wilhelm, Jakob Engblom, Andreas Ermedahl, Niklas Holsti, Stephan Thesing, David Whalley, Guillem Bernat, Christian Ferdinand, Reinhold Heckmann, Tulika Mitra et al. 2008. The worst-case execution-time problem-overview of methods and survey of tools. ACM Trans. Embedd. Comput. Syst. 7, 3 (2008), 36.
[60]
Ifor Williams. 1989. The MUSHROOM machine-an architecture for symbolic processing. In Proceedings of the IEE Colloquium on VLSI and Architectures for Symbolic Processing. IET, 4–1.
[61]
Paul R. Wilson. 1992. Uniprocessor garbage collection techniques. In Memory Management. Springer, 1–42.
[62]
Jonathan Woodruff, Robert N. M. Watson, David Chisnall, Simon W. Moore, Jonathan Anderson, Brooks Davis, Ben Laurie, Peter G. Neumann, Robert Norton, and Michael Roe. 2014. The CHERI capability model: Revisiting RISC in an age of risk. In Proceedings of the ACM/IEEE 41st International Symposium on Computer Architecture (ISCA’14). IEEE, 457–468.
[63]
Zerynth. 2019. Zerynth Virtual Machine. Retrieved from https://www.zerynth.com/zerynth-virtual-machine.
[64]
Benjamin Zorn. 1993. The measured cost of conservative garbage collection. Softw.: Pract. Exper. 23, 7 (1993), 733–756.

Cited By

View all
  • (2022)Approach to Software Integration of Heterogeneous Sources of Medical Data Based on Microservice ArchitectureПодход к интеграции разнородных источников медицинских данных на основе микросервисной архитектурыInformatics and AutomationИнформатика и автоматизация10.15622/ia.21.5.221:5(881-915)Online publication date: 28-Sep-2022
  • (2022)Synthesized In-BramGarbage Collection for Accelerators with Immutable Memory2022 32nd International Conference on Field-Programmable Logic and Applications (FPL)10.1109/FPL57034.2022.00019(47-53)Online publication date: Aug-2022

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Embedded Computing Systems
ACM Transactions on Embedded Computing Systems  Volume 20, Issue 5
September 2021
342 pages
ISSN:1539-9087
EISSN:1558-3465
DOI:10.1145/3468851
  • Editor:
  • Tulika Mitra
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Publisher

Association for Computing Machinery

New York, NY, United States

Journal Family

Publication History

Published: 09 July 2021
Accepted: 01 March 2021
Revised: 01 November 2020
Received: 01 December 2019
Published in TECS Volume 20, Issue 5

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Garbage collection
  2. memory
  3. memory management
  4. real-time
  5. reliability
  6. static analysis

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)70
  • Downloads (Last 6 weeks)7
Reflects downloads up to 06 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2022)Approach to Software Integration of Heterogeneous Sources of Medical Data Based on Microservice ArchitectureПодход к интеграции разнородных источников медицинских данных на основе микросервисной архитектурыInformatics and AutomationИнформатика и автоматизация10.15622/ia.21.5.221:5(881-915)Online publication date: 28-Sep-2022
  • (2022)Synthesized In-BramGarbage Collection for Accelerators with Immutable Memory2022 32nd International Conference on Field-Programmable Logic and Applications (FPL)10.1109/FPL57034.2022.00019(47-53)Online publication date: Aug-2022

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

HTML Format

View this article in HTML Format.

HTML Format

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media