CSc 520 - Principles of Programming Languages
11 : Memory Management -- GC -- Uncooperative Languages

Christian Collberg

Department of Computer Science

University of Arizona

1 Uncooperative Languages

There is some information which is necessary in order to perform automatic memory management:

  1. We need to find the roots of the object graph, i.e. the pointers from the stack, registers, or global variables which point to objects on the heap.
  2. We need to know the size, the beginning, and end of each object.
  3. For each object we need to find which of its fields are pointers.

2 Uncooperative Languages...

3 Uncooperative Languages...

4 Uncooperative Languages...

We need to know

  1. the roots of the object graph.
  2. the size, the beginning, and end of each object.
  3. which object fields are pointers.
Finding Roots:
2#2

5 Uncooperative Languages...

Finding the beginning:
3#3

Finding pointers:
4#4


Conservative Garbage Collection


6 Conservative GC

Main Ideas:

7 Conservative GC...

8 Conservative GC...

Conservative1

9 Readings and References



Christian Collberg 2008-04-29