Garbage Collection Algorithms

Course

Online

£ 10 + VAT

Description

  • Type

    Course

  • Methodology

    Online

  • Start date

    Different dates available

Memory leaks and dangling pointers are the main issues of 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 the correct order - but suddenly your program crashes since you forgot about the 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 them for future reuse.In the Garbage Collection Algorithms class, we study all different techniques and algorithms related to automatic memory management, which are used today in 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 that initially were positioned as “memory-safe”, such as Rust, eventually 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.

Facilities

Location

Start date

Online

Start date

Different dates availableEnrolment now open

About this course

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

Questions & Answers

Add your question

Our advisors and other users will be able to reply to you

Who would you like to address this question to?

Fill in your details to get a reply

We will only publish your name and question

Reviews

This centre's achievements

2021

All courses are up to date

The average rating is higher than 3.7

More than 50 reviews in the last 12 months

This centre has featured on Emagister for 4 years

Subjects

  • Programming
  • Writing
  • Layout
  • Algorithms
  • Translation

Course programme

Memory management 7 lectures 39:31 Lecture 1: Allocation types preview
  • Static, Stack, Heap allocations
  • Compile vs. Runtime allocation
  • Fixed size vs. Dynamic size allocation
  • Recursion
  • Stack frame
  • Stack overflow
  • Memory leaks, dangling pointers
Lecture 2: Manual memory management preview
  • Memory leaks: forget to deallocate
  • Dangling pointers: deallocate too early
  • Human factor in memory management
Lecture 3: Object header
  • Memory alignment
  • Object header
  • Collector meta-information
Lecture 4: Virtual memory and Memory layout preview
  • Virtual address space
  • Kernel space vs. User space
  • Code segment, data segment
  • Stack and stack pointer
  • Heap and break pointer
  • Memory mapping
  • Memory management unit (MMU)
  • Translation lookaside buffer (TLB)
Lecture 5: Mutator, Allocator, Collector
  • Life cycle of a GC’ed program
  • Mutator: user program
  • Allocator: memory allocation
  • Collector: garbage collector
  • Mutator vs. Collector object graph view
  • GC pause
  • “Stop the World” state
  • System calls to invoke GC from Mutator
Lecture 6: Allocators: Free-list vs. Sequential
  • Sequential (aka “Bump”) allocator
  • Free-list allocator
  • First fit, Next-fit, Best-fit searches
  • Segregated list
  • Blocks coalescing and splitting
  • Lab session to implement malloc and free
Example of writing a memory allocator: Lecture 7: Semantic vs. Syntactic garbage
  • Semantic: objects that will not be reached
  • Syntactic: objects that cannot be reached
Memory management 7 lectures 39:31 Lecture 1: Allocation types preview
  • Static, Stack, Heap allocations
  • Compile vs. Runtime allocation
  • Fixed size vs. Dynamic size allocation
  • Recursion
  • Stack frame
  • Stack overflow
  • Memory leaks, dangling pointers
Lecture 2: Manual memory management preview
  • Memory leaks: forget to deallocate
  • Dangling pointers: deallocate too early
  • Human factor in memory management
Lecture 3: Object header
  • Memory alignment
  • Object header
  • Collector meta-information
Lecture 4: Virtual memory and Memory layout preview
  • Virtual address space
  • Kernel space vs. User space
  • Code segment, data segment
  • Stack and stack pointer
  • Heap and break pointer
  • Memory mapping
  • Memory management unit (MMU)
  • Translation lookaside buffer (TLB)
Lecture 5: Mutator, Allocator, Collector
  • Life cycle of a GC’ed program
  • Mutator: user program
  • Allocator: memory allocation
  • Collector: garbage collector
  • Mutator vs. Collector object graph view
  • GC pause
  • “Stop the World” state
  • System calls to invoke GC from Mutator
Lecture 6: Allocators: Free-list vs. Sequential
  • Sequential (aka “Bump”) allocator
  • Free-list allocator
  • First fit, Next-fit, Best-fit searches
  • Segregated list
  • Blocks coalescing and splitting
  • Lab session to implement malloc and free
Example of writing a memory allocator: Lecture 7: Semantic vs. Syntactic garbage
  • Semantic: objects that will not be reached
  • Syntactic: objects that cannot be reached
Lecture 1: Allocation types preview
  • Static, Stack, Heap allocations
  • Compile vs. Runtime allocation
  • Fixed size vs. Dynamic size allocation
  • Recursion
  • Stack frame
  • Stack overflow
  • Memory leaks, dangling pointers
Lecture 1: Allocation types preview
  • Static, Stack, Heap allocations
  • Compile vs. Runtime allocation
  • Fixed size vs. Dynamic size allocation
  • Recursion
  • Stack frame
  • Stack overflow
  • Memory leaks, dangling pointers
Lecture 1: Allocation types preview
  • Static, Stack, Heap allocations
  • Compile vs. Runtime allocation
  • Fixed size vs. Dynamic size allocation
  • Recursion
  • Stack frame
  • Stack overflow
  • Memory leaks, dangling pointers
Lecture 1: Allocation types preview
  • Static, Stack, Heap allocations
  • Compile vs. Runtime allocation
  • Fixed size vs. Dynamic size allocation
  • Recursion
  • Stack frame
  • Stack overflow
  • Memory leaks, dangling pointers
  • Static, Stack, Heap allocations
  • Compile vs. Runtime allocation
  • Fixed size vs. Dynamic size allocation
  • Recursion
  • Stack frame
  • Stack overflow
  • Memory leaks, dangling pointers
  • Static, Stack, Heap allocations
  • Compile vs. Runtime allocation
  • Fixed size vs. Dynamic size allocation
  • Recursion
  • Stack frame
  • Stack overflow
  • Memory leaks, dangling pointers
Lecture 2: Manual memory management preview
  • Memory leaks: forget to deallocate
  • Dangling pointers: deallocate too early
  • Human factor in memory management
Lecture 2: Manual memory management preview
  • Memory leaks: forget to deallocate
  • Dangling pointers: deallocate too early
  • Human factor in memory management
Lecture 2: Manual memory management preview
  • Memory leaks: forget to deallocate
  • Dangling pointers: deallocate too early
  • Human factor in memory management
Lecture 2: Manual memory management preview
  • Memory leaks: forget to deallocate
  • Dangling pointers: deallocate too early
  • Human factor in memory management
  • Memory leaks: forget to deallocate
  • Dangling pointers: deallocate too early
  • Human factor in memory management
  • Memory leaks: forget to deallocate
  • Dangling pointers: deallocate too early
  • Human factor in memory management
Lecture 3: Object header
  • Memory alignment
  • Object header
  • Collector meta-information
Lecture 3: Object header
  • Memory alignment
  • Object header
  • Collector meta-information
Lecture 3: Object header
  • Memory alignment
  • Object header
  • Collector meta-information
Lecture 3: Object header
  • Memory alignment
  • Object header
  • Collector meta-information
  • Memory alignment
  • Object header
  • Collector meta-information
  • Memory alignment
  • Object header
  • Collector meta-information
Lecture 4: Virtual memory and Memory layout preview
  • Virtual address space
  • Kernel space vs. User space
  • Code segment, data segment
  • Stack and stack pointer
  • Heap and break pointer
  • Memory mapping
  • Memory management unit (MMU)
  • Translation lookaside buffer (TLB)
Lecture 4: Virtual memory and Memory layout preview
  • Virtual address space
  • Kernel space vs. User space
  • Code segment, data segment
  • Stack and stack pointer
  • Heap and break pointer
  • Memory mapping
  • Memory management unit (MMU)
  • Translation lookaside buffer (TLB)
Lecture 4: Virtual memory and Memory layout preview
  • Virtual address space
  • Kernel space vs. User space
  • Code segment, data segment
  • Stack and stack pointer
  • Heap and break pointer
  • Memory mapping
  • Memory management unit (MMU)
  • Translation lookaside buffer (TLB)
Lecture 4: Virtual memory and Memory layout preview
  • Virtual address space
  • Kernel space vs. User space
  • Code segment, data segment
  • Stack and stack pointer
  • Heap and break pointer
  • Memory mapping
  • Memory management unit (MMU)
  • Translation lookaside buffer (TLB)
  • Virtual address space
  • Kernel space vs. User space
  • Code segment, data segment
  • Stack and stack pointer
  • Heap and break pointer
  • Memory mapping
  • Memory management unit (MMU)
  • Translation lookaside buffer (TLB)
  • Virtual address space
  • Kernel space vs. User space
  • Code segment, data segment
  • Stack and stack pointer
  • Heap and break pointer
  • Memory mapping
  • Memory management unit (MMU)
  • Translation lookaside buffer (TLB)
Lecture 5: Mutator, Allocator, Collector
  • Life cycle of a GC’ed program
  • Mutator: user program
  • Allocator: memory allocation
  • Collector: garbage collector
  • Mutator vs. Collector object graph view
  • GC pause
  • “Stop the World” state
  • System calls to invoke GC from Mutator
Lecture 5: Mutator, Allocator, Collector
  • Life cycle of a GC’ed program
  • Mutator: user program
  • Allocator: memory allocation
  • Collector: garbage collector
  • Mutator vs. Collector object graph view
  • GC pause
  • “Stop the World” state
  • System calls to invoke GC from Mutator
Lecture 5: Mutator, Allocator, Collector
  • Life cycle of a GC’ed program
  • Mutator: user program
  • Allocator: memory allocation
  • Collector: garbage collector
  • Mutator vs. Collector object graph view
  • GC pause
  • “Stop the World” state
  • System calls to invoke GC from Mutator
Lecture 5: Mutator, Allocator, Collector
  • Life cycle of a GC’ed program
  • Mutator: user program
  • Allocator: memory allocation
  • Collector: garbage collector
  • Mutator vs. Collector object graph view
  • GC pause
  • “Stop the World” state
  • System calls to invoke GC from Mutator
  • Life cycle of a GC’ed program
  • Mutator: user program
  • Allocator: memory allocation
  • Collector: garbage collector
  • Mutator vs. Collector object graph view
  • GC pause
  • “Stop the World” state
  • System calls to invoke GC from Mutator
  • Life cycle of a GC’ed program
  • Mutator: user program
  • Allocator: memory allocation
  • Collector: garbage collector
  • Mutator vs. Collector object graph view
  • GC pause
  • “Stop the World” state
  • System calls to invoke GC from Mutator
Lecture 6: Allocators: Free-list vs. Sequential
  • Sequential (aka “Bump”) allocator
  • Free-list allocator
  • First fit, Next-fit, Best-fit searches
  • Segregated list
  • Blocks coalescing and splitting
  • Lab session to implement malloc and free
Example of writing a memory allocator: Lecture 6: Allocators: Free-list vs. Sequential
  • Sequential (aka “Bump”) allocator
  • Free-list allocator
  • First fit, Next-fit, Best-fit searches
  • Segregated list
  • Blocks coalescing and splitting
  • Lab session to implement malloc and free
Example of writing a memory allocator: Lecture 6: Allocators: Free-list vs. Sequential
  • Sequential (aka “Bump”) allocator
  • Free-list allocator
  • First fit, Next-fit, Best-fit searches
  • Segregated list
  • Blocks coalescing and splitting
  • Lab session to implement malloc and free
Example of writing a memory allocator: Lecture 6: Allocators: Free-list vs. Sequential
  • Sequential (aka “Bump”) allocator
  • Free-list allocator
  • First fit, Next-fit, Best-fit searches
  • Segregated list
  • Blocks coalescing and splitting
  • Lab session to implement malloc and free
Example of writing a memory allocator: (aka “Bump”) allocator
  • Free-list allocator
  • First fit, Next-fit, Best-fit searches
  • Segregated list
  • Blocks coalescing and splitting
  • Lab session to implement malloc and free
  • Example of writing a memory allocator: (aka “Bump”) allocator
  • Free-list allocator
  • First fit, Next-fit, Best-fit searches
  • Segregated list
  • Blocks coalescing and splitting
  • Lab session to implement malloc and free
  • Example of writing a memory allocator: Lecture 7: Semantic vs. Syntactic garbage
    • Semantic: objects that will not be reached
    • Syntactic: objects that cannot be reached
    Lecture 7: Semantic vs. Syntactic garbage
    • Semantic: objects that will not be reached
    • Syntactic: objects that cannot be reached
    Lecture 7: Semantic vs. Syntactic garbage
    • Semantic: objects that will not be reached
    • Syntactic: objects that cannot be reached
    Lecture 7: Semantic vs. Syntactic garbage
    • Semantic: objects that will not be reached
    • Syntactic: objects that cannot be reached
    • Semantic: objects that will not be reached
    • Syntactic: objects that cannot be reached
    • Semantic: objects that will not be reached
    • Syntactic: objects that cannot be reached
    Garbage Collectors. 5 lectures 44:55 Lecture 8: Tracing vs. Direct collectors
    • Tracing: trace for alive objects
    • Direct: directly identify the garbage
    • Main four collection algorithms
    Lecture 9: Mark-Sweep collector preview
    • Mark phase: objects trace
    • Sweep phase: reclamation
    • Detailed algorithm description with code example
    • Non-moving collector
    • Free-list allocation
    • Heap fragmentation
    Example of implementing a Mark-Sweep GC in C++ : Lecture 10: Mark-Compact collector
    • Mark phase: objects trace
    • Compact phase: objects relocation
    • Fixing fragmentation issue
    • Moving collector
    • Forwarding address
    • Lisp 2 algorithm detailed description
    • Sequential allocator
    Lecture 11: Copying collector
    • Semi-space collector
    • Heap reservation
    • Forwarding address
    • Objects evacuation
    • Fixing child pointers
    • Bump-allocator
    • Detailed algorithm description with code example
    Lecture 12: Reference counting collector
    • Directly identify the garbage
    • Strong vs l
      • Heap...

    Additional information

    Basic data structures and algorithms (trees, graphs, linked lists, etc) Basic knowledge about computer memory (bytes, addresses, pointers)

    Garbage Collection Algorithms

    £ 10 + VAT