Hostname: page-component-6766d58669-tq7bh Total loading time: 0 Render date: 2026-05-14T13:45:21.925Z Has data issue: false hasContentIssue false

Tail recursion without space leaks

Published online by Cambridge University Press:  07 November 2008

Richard Jones
Affiliation:
Computing Laboratory, University of Kent at Canterbury, Canterbury, Kent CT2 7NF, UK (rej@ukc.ac.uk)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

The G-machine (Johnsson, 1987; Peyton Jones, 1987) is a compiled graph reduction machine for lazy functional languages. The G-machine compiler contains many optimizations to improve performance. One set of such optimizations is designed to improve the performance of tail recursive functions. Unfortunately, the abstract machine is subject to a space leak—objects are unnecessarily preserved by the garbage collector. This paper analyses why a particular form of space leak occurs in the G-machine, and presents some ideas for fixing this problem. This phenomena in other abstract machines is also examined briefly.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 1992
Submit a response

Discussions

No Discussions have been published for this article.