Garbage Collection Algorithms

Automatic memory management techniques

4.55 (146 reviews)
Udemy
platform
English
language
Other
category
1,201
students
2.5 hours
content
Mar 2021
last update
$64.99
regular price

What you will learn

Algorithms and data structures behind Automatic Memory Management in computer programs.

Memory management history: Static, Stack, Heap allocations

Virtual memory and Memory Layout

Tracing vs. Direct collectors

Semantic vs. Syntactic garbage

Mark-Sweep garbage collector

Mark-Compact collector

Reference counting collector

Copying collector

Generational collector

Parallel, Incremental, Concurrent collectors

Tri-color abstraction and marking

GC Barriers

Description

Essentials of Garbage Collectors

Memory leaks and dangling pointers are the main issues of the manual memory management. You delete a parent node in a linked list, forgetting to delete all its children first — and your memory is leaking. You delete an object chain in correct order — but suddenly your program crashes since you forgot about second owner of this resource, which now tries to dereference a null-pointer.

To avoid these issues, most of the modern high-level programming languages implement automatic memory management. You allocate objects manually, however don’t bother with their deallocation: a special program, garbage collector, knows how to automatically deallocate them correctly, and reclaim for future reuse.

In the Essentials of Garbage Collectors class we study all different techniques and algorithms related to the automatic memory management, which are used today on practice.


Who this class is for?

First of all, for compiler engineers.

In implementing your programming language, there is a very high chance you’ll need to implement a garbage collector. Even languages which initially were positioned as “memory-safe”, such as Rust, eventual implemented automatic reference counting (ARC) and other collectors.

To reiterate: in most of the modern high-level programming languages, a garbage collector module (or multiple GC modules, like in Java) is pretty much a requirement today.


What if I don't implement programming languages every day?

If you are not a compiler engineer, then the class can still be interesting for you. Implementing a garbage collector or a memory manager in general, is a pretty advanced engineering task. It's a simple trick: you take some complex project (such as a garbage collector, compiler, interpreter, etc), and while building it, you learn all different data structures and algorithms. And then come back to "every-day programming", improved as a better engineer, with the transferable generic knowledge of complex systems.


Do I need C or C++ for this project?

Not really! Of course, C and C++ are probably the best languages for raw memory manipulations and fit well here, however in the course we study generic design algorithms and focus mainly on theoretical aspects of garbage collectors and memory allocators. This means you can implement them in any language you want. For example, you can allocate an `ArrayBuffer` in JavaScript for a virtual heap, or similarly `bytearray` in Python, Rust, etc.

Most of the algorithms in the course are described in generic pseudo-code, so you can port them to any language.


What's specific in this class?

The main things of these lectures are:

  • Concise and straight to the point. Each lecture is self-sufficient, concise, and describes information directly related to the topic, not distracting on unrelated materials or talks.

  • Animated presentation combined with live-editing notes. This makes understanding of the topics easier, and shows how (and when at time) the object structures are connected. Static slides simply don’t work for a complex content.


Reading materials

As further reading and additional literature for this course the following books are recommended:

  • The Garbage Collection Handbook: The Art of Automatic Memory Management by Antony Hosking, Eliot Moss, and Richard Jones

  • The Compiler Design Handbook: Optimizations and Machine Code generation by Y.N. Srikant, Priti Shankar

Content

Memory management

Allocation types
Manual memory management
Object header
Virtual memory and Memory layout
Mutator, Allocator, Collector
Allocators: Free-list vs. Sequential
Semantic vs. Syntactic garbage

Garbage Collectors

Tracing vs. Direct collectors
Mark-Sweep collector
Mark-Compact collector
Copying collector
Reference counting collector

Advance topics

Generational collector
Mark-Region GC: Immix collector
Parallel, Incremental, Concurrent GC
Tri-color abstraction
GC barriers

Screenshots

Garbage Collection Algorithms - Screenshot_01Garbage Collection Algorithms - Screenshot_02Garbage Collection Algorithms - Screenshot_03Garbage Collection Algorithms - Screenshot_04

Reviews

Jonathan
September 3, 2023
I've recently started working on a mature GC (the "MPS") and this course was great for reinforcing my on-the-job learning. Thanks!
Julian
December 15, 2021
Dmitry is superior to other programming instructors. He is concise, to the point, and extremely clear on details. This is hugely preferable to the usual 'long winded C++ lecturers'.
Martin
August 1, 2021
Great course if you need an overview of how garbage collection works in real-world systems. Covers the major techniques and highlights strengths and weaknesses of the various approaches.
Yermek
April 14, 2021
Course is really awesome! Instructors speech and explanation is very clear and concise. I also love the animated slides which make it very clear for "visual" people. Totally worth the money!
Pradeep
February 1, 2021
section 1 is too good. but after session 2 & 3 needs to have more details and lab sessions with code..
Ranajit
September 15, 2020
The information is rare and not easily available in video format. The reference documentation reads are usually not this interesting and easy as in these videos. A little more depth would have made it a perfect tutorial. Thank you for enlightening us.
John
June 21, 2020
This was a good introductory course to automatic garbage collectors and memory management generally. The concepts were very clearly explained.
Ankur
April 7, 2020
Complex ideas presented in a simple and intuitive manner. Love the pseudocode that represents a complex algorithm but still fits a slide
Advait
February 24, 2020
This course was innovative and good in content. Animations helped to understand topics more clearly, Thanks for having course for compiler engineers
Lucaregini
August 5, 2019
Very shallow. Contains only a brief summary of the main algorithms and doesn't go deep into advanced concepts. Immix GC is not even cited. A part from some pseudo-code examples there is no real implementation code

Charts

Price

Garbage Collection Algorithms - Price chart

Rating

Garbage Collection Algorithms - Ratings chart

Enrollment distribution

Garbage Collection Algorithms - Distribution chart

Related Topics

2441328
udemy ID
7/3/2019
course created date
8/16/2019
course indexed date
Bot
course submited by