Note that the implementation videos, which are included in the playlist, are optional.
Automatic memory management relives the programmer of the tedious and error-prone task of determining where to put calls to free. We look at the two main forms of automatic memory management: reference counting and garbage collection.
- GC 1: Introduction 4:54Motivation and overview for automatic memory management.
- Reference counting is a form of automatic memory management that centralizes the tracking of how many references to an object are outstanding, so the object’s memory can be freed when the last reference is removed.Reference counting has sometimes been called a form of garbage collection. It makes more sense to say that reference counting and garbage collection are two forms of automatic memory management.
- An overview of a referencing counting algorithm.
- Optional GC 4: Reference counting implementation 4:35A walk-through for an implementation of reference counting. This video also explains the organization of the example code that shows reference counting and garbage collector variations.This video is optional, because you will not need to know the implementation details for any homework assignment or test. Still, a look at the implementation is recommended, because it covers all sorts of details to help you see how reference counting really works.
- GC 5: Cycles 0:54Reference counting doesn’t handle cycles.
- Garbage collection handles cycles by addressing the more direct question of “which objects can still be used by the program?” instead of “which objects are referenced from somewhere?”
- An overview of a garbage-collection algorithm.
- Optional GC 8: Garbage collection implementation 6:36A walk-through for an implementation of garbage collection.This video is optional for the same reason that all of the implementation videos are optional (see above).
- Conservative garbage collection implements automatic memory management without specific support from the language implementation.The Boehm collector is the seminal and widely used conservative collector for C.
- Optional GC 10: Conservative garbage collection implementation 3:07A walk-through for an implementation of conservative garbage collection.This video is optional for the same reason that all of the implementation videos are optional (see above).
- A two-space copying collector implements an especially simple allocation and collection strategy that usually performs well.
- Optional GC 12: Two-space collection implementation 4:43A walk-through for an implementation of a two-space copying collector.This video is optional for the same reason that all of the implementation videos are optional (see above).
- GC 13: Tags 2:01A more realistic garbage collector deals with multiple shapes of values, instead of just tree nodes. Tags are typically associated with objects to identify shapes tp the garbage collector.
- Stepping through the operation of a two-spece collector on tagged objects in a tiny setting.
- Some pointers and comments on GC topics that are not covered here.