












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













Garbage Collection
Major Areas of Memory
Cells and Liveness
Garbage
Example of Garbage class node { int value; node next; } node p, q; p = new node(); q = new node(); q = p; delete p;
Dangling References
Garbage Collection
Reference Counter
Reference Counts
Reference Counter โ (^) Directly keeps track of live cells โ (^) Doesnโt detect all garbage
slide 16 root set Heap space
slide 17 root set Heap space
slide 19 root set Heap space
Reset mark bit of marked cells Free unmarked cells
GC and Programming Languages
โ (^) Cooperative langs: Lisp, Scheme, Prolog, Smalltalk โฆ โ (^) Uncooperative languages: C and C++ โ (^) But garbage collection libraries have been built for C/C++