Skip to main content

Garbage collection via dynamic type inference - A formal treatment -

  • Conference paper
  • First Online:
Types in Compilation (TIC 1998)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1473))

Included in the following conference series:

Abstract

A garbage collection (GC) scheme — what we call type inference GC — that dynamically performs type inference is studied. In contrast to conventional garbage collection that can collect only unreachable objects, this scheme can collect objects that are reachable yet semantically garbage. The idea is to exploit ML-like polymorphic types that can tell whether or not each object may be used in the rest of computation. There has been some work studying algorithms of the GC scheme. However, their descriptions had some obscurity in details of their methods, and did not give any formal correctness proof that captures the details. These facts, we believe, make their descriptions still unconvincing for implementors.

This paper aims to present a trustworthy specification of the GC scheme. In this specification, we first consider an underlying language that suitably reflects implementation details, on top of which we then formulate an algorithm of type inference GC, and formally prove its correctness. A significant point in our formulation is that we specify how to deal with Hindley-Milner polymorphism. Furthermore, showing our experimental results, we discuss in what cases this GC scheme is beneficial.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. S. Aditya, C. Flood, and J. Hicks. Garbage collection for strongly-typed languages using run-time type reconstruction. In Proceedings of Conference on LISP and Functional Programming, pages 12–23, 1994.

    Google Scholar 

  2. H. G. Baker. Unify and conquer (garbage, updating, aliasing,...) in functional languages. In Proceedings of Conference on LISP and Functional Programming, pages 218–226, 1990.

    Google Scholar 

  3. L. Birkedal, M. Tofte, and M. Vejlstrup. From Region Inferrence to von Neumann Machines via Region Representation. In Conference record of Symposium on Principles of Programming Languages, pages 171–183, 1996.

    Google Scholar 

  4. P. Fradet. Collecting more garbage. In Proceedings of Conference on LISP and Functional Programming, pages 24–33, 1994.

    Google Scholar 

  5. B. Goldberg and M. Glogar. Polymorphic type reconstruction for garbage collection without tags. In Proceedings of Conference on LISP and Functional Programming, pages 53–65, 1992.

    Google Scholar 

  6. K. Inoue, H. Seki, and H. Yagi. Analysis of functional programs to detect run-time garbage cells. ACM Transactions on Programming, Languages and Systems, 10(4): 555–579, 1988.

    Article  MATH  Google Scholar 

  7. R. Jones. Tail recursion without space leaks. Journal of Functional Programming, 2(1): 73–79, 1992.

    Article  MATH  Google Scholar 

  8. S. B. Jones and D. L. Métayer. Compile-time garbage collection by sharing analysis. In Conference Proceedings of Functional Programming Languages and Computer Architecture, pages 54–74, Imperial College, London, September 1989.

    Google Scholar 

  9. S. L. P. Jones. The Implementation of Functional Programming Languages. Prentice-Hall, 1987.

    Google Scholar 

  10. R. Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17: 348–185, 1978.

    Article  MATH  MathSciNet  Google Scholar 

  11. G. Morrisett. Compiling with Types. PhD thesis, School of Computer Science Carnegie Mellon University, 1995.

    Google Scholar 

  12. G. Morrisett, M. Felleisen, and R. Harper. Abstract models of memory management. In Proceedings of Functional Programming Languages and Computer Architecture, pages 66–76, 1995.

    Google Scholar 

  13. J. Reynolds. Types, abstraction, and parametric polymorphism. In Information Processing, volume 83, pages 513–523, 1983.

    Google Scholar 

  14. J. A. Robinson. A machine-oriented logic based on the resolution principle. Journal of ACM, 12, 1965.

    Google Scholar 

  15. M. Tofte and J.-P. Talpin. Implementation of the Typed Call-by-Value λ-calculus using a Stack of Regions. In Conference record of Symposium on Principles of Programming Languages, pages 188–201, 1994.

    Google Scholar 

  16. A. Tolmach. Tag-free garbage collection using explicit type parameters. In Proceedings of Conference on LISP and Functional Programming, pages 1–11, 1994.

    Google Scholar 

  17. P. Wadler. Fixing some space leaks with a garbage collector. Software Practice and Experience, 17(9): 595–608, September 1987.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Xavier Leroy Atsushi Ohori

Rights and permissions

Reprints and permissions

Copyright information

© 1998 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Hosoya, H., Yonezawa, A. (1998). Garbage collection via dynamic type inference - A formal treatment -. In: Leroy, X., Ohori, A. (eds) Types in Compilation. TIC 1998. Lecture Notes in Computer Science, vol 1473. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0055520

Download citation

  • DOI: https://doi.org/10.1007/BFb0055520

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-64925-0

  • Online ISBN: 978-3-540-68308-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics