Accurate Garbage Collection in Uncooperative Environments with Lazy Pointer Stacks

  • Jason Baker
  • Antonio Cunei
  • Filip Pizlo
  • Jan Vitek
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4420)


Implementing a new programming language by the means of a translator to an existing language is attractive as it provides portability over all platforms supported by the host language and reduces the development time as many low-level tasks can be delegated to the host compiler. The C and C++ programming languages are popular choices for many language implementations due to the availability of efficient compilers on many platforms, and good portability. For garbage-collected languages, however, they are not a perfect match as they provide no support for accurately discovering pointers to heap-allocated data. We evaluate the published techniques, and propose a new mechanism, lazy pointer stacks, for performing accurate garbage collection in such uncooperative environments. We implemented the new technique in the Ovm Java virtual machine with our own Java-to-C++ compiler and GCC as a back-end, and found that our technique outperforms existing approaches.


  1. 1.
    Free Software Foundation: Gnu compiler collection,
  2. 2.
    Boehm, H.J., Weiser, M.: Garbage collection in an uncooperative environment. Software—Practice and Experience 18(9), 807–820 (1988)CrossRefGoogle Scholar
  3. 3.
    Boehm, H.J.: Space efficient conservative garbage collection. In: Proceedings of the ACM Conference on Programming Language Design and Implementation, vol. 26, pp. 197–206 (1991)Google Scholar
  4. 4.
    Baker, J., et al.: A real-time Java virtual machine for avionics. In: Proceedings of the 12th IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS 2006), IEEE Computer Society Press, Los Alamitos (2006)Google Scholar
  5. 5.
    Vitek, J., et al.: The Ovm Project,
  6. 6.
    Palacz, K., et al.: Engineering a common intermediate representation for the Ovm framework. The Science of Computer Programming 57(3), 357–378 (2005)MATHCrossRefMathSciNetGoogle Scholar
  7. 7.
    Flack, C., Hosking, T., Vitek, J.: Idioms in Ovm. Technical Report CSD-TR-03-017, Purdue University Department of Computer Sciences (2003)Google Scholar
  8. 8.
    Henderson, F.: Accurate garbage collection in an uncooperative environment. In: Proceedings of the ACM International Symposium on Memory Management, vol. 38, pp. 256–263. ACM Press, New York (2002)Google Scholar
  9. 9.
    Free Software Foundation: Gnu binutils,
  10. 10.
    Pizlo, F., Vitek, J.: An empirical evaluation of memory management alternatives for Real-Time Java. In: Proceedings of the 27th IEEE Real-Time Systems Symposium (RTSS 2006), Rio de Janeiro, Brazil, 5-8 December (2006)Google Scholar
  11. 11.
    Baker, H.G.: List processing in real time on a serial computer. Communications of the ACM 21(4), 280–294 (1978)MATHCrossRefGoogle Scholar
  12. 12.
    Bacon, D.F., Cheng, P., 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, vol. 38, pp. 285–298 (2003)Google Scholar
  13. 13.
    Siebert, F.: Constant-Time Root Scanning for Deterministic Garbage Collection. In: Wilhelm, R. (ed.) CC 2001 and ETAPS 2001. LNCS, vol. 2027, pp. 304–318. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  14. 14.
    Bartlett, J.F.: Compacting garbage collection with ambiguous roots. Research Report 88/2, Western Research Laboratory, Digital Equipment Corporation (1988)Google Scholar
  15. 15.
    Smith, F., Morrisett, J.G.: Comparing mostly-copying and mark-sweep conservative collection. In: Proceedings of the ACM International Symposium on Memory Management, vol. 34, pp. 68–78. ACM Press, New York (1998)Google Scholar
  16. 16.
    Bartlett, J.F.: Mostly-copying garbage collection picks up generations and C++. Technical Note TN-12, Western Research Laboratory, Digital Equipment Corporation (1989)Google Scholar
  17. 17.
    Jones, S.P., Ramsey, N., Reig, F.: C–: a portable assembly language that supports garbage collection. In: Nadathur, G. (ed.) PPDP 1999. LNCS, vol. 1702, Springer, Heidelberg (1999)CrossRefGoogle Scholar
  18. 18.
  19. 19.
    Diwan, A., Moss, J.E.B., Hudson, R.L.: Compiler support for garbage collection in a statically typed language. In: Proceedings of the ACM Conference on Programming Language Design and Implementation, vol. 27, pp. 273–282 (1992)Google Scholar
  20. 20.
    Cunei, A.: Use of Preemptive Program Services with Optimised Native Code. PhD thesis, University of Glasgow (2004)Google Scholar

Copyright information

© Springer Berlin Heidelberg 2007

Authors and Affiliations

  • Jason Baker
    • 1
  • Antonio Cunei
    • 1
  • Filip Pizlo
    • 1
  • Jan Vitek
    • 1
  1. 1.Computer Science Department, Purdue University, West Lafayette, IN 47906USA

Personalised recommendations