Explain how it is possible to “leak memory” using a reference counting garbage collector

Describe how a stack is used to implement procedures and functions
March 21, 2023
Present a right-most derivation for the string (a, ((a, a), (a, a)))
March 21, 2023

Explain how it is possible to “leak memory” using a reference counting garbage collector

2007 Paper 6 Question 6
Compiler Construction
(a) Garbage Collection.
(i) Explain how it is possible to “leak memory” using a reference counting
garbage collector. [3 marks]
(ii) Describe any technique that might be used to address this problem.
[3 marks]
(b) Explain in detail how we might translate code generated for a stack-only
machine (such as the JVM) to a register-based machine (such as ARM).
[6 marks]
(c) Describe in detail how static and dynamic methods are compiled differently
for object-oriented languages with single inheritance. [8 marks]