Save this video free

ECE344 Fall 2026 (Sec 1) Lec 29 - Advanced Memory Allocation

Jon Eyolfson · 55:14 · Watch on YouTube

Part of University of Toronto ECE 344. See all 26 lectures and search them

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

Jon Eyolfson compares general free-list allocation with faster strategies that restrict allocation sizes, including segregated size classes, per-thread caches, bump arenas, buddy allocation, and slab caches. He explains how Linux combines the buddy allocator for physical frames with SLUB caches for common kernel objects, then connects physical-memory compaction and virtual allocation to DMA, huge pages, and the limits of reference counting.

Key takeaways

Chapters

0:00 Why General Free-List Allocation Can Fragment and Slow Down
6:20 Segregated Size Classes and In-Place Free-List Pointers
12:02 Multiple Threads, Allocator Arenas, and Thread Caches
13:56 Bump Arenas for Objects with Shared Lifetimes
16:14 Why Kernels Need Buddy Allocation for Physical Memory
19:43 Buddy Splitting, XOR Buddy Lookup, and Coalescing
27:02 Linux Buddy Allocator Orders, Zones, and /proc/buddyinfo
28:54 Slab Caches and Linux's SLUB Allocator
35:41 kmalloc, vmalloc, DMA, and Physical-Memory Compaction
40:02 Reference Counting and Automatic Object Deallocation
48:38 Reference Cycles, weak_ptr, and Garbage Collection

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

1:41 I >> All right, welcome back to operating

5:08 systems. So we get to carry on our journey. We are almost done. So this is aside from one more content lecture next week. It's pretty much reviewing our home free. And if you didn't see the announcement, no lecture Tuesday, so you can concentrate on the demos and have time for that. Hopefully I'll be able to show up for some of them, see what some of you guys cooked up. But let's continue on our journey for advanced memory management. So what we had before, we had thinking about what happened if we had to implement malloc ourselves. And we were like, okay, well, we could just have a free list and if we handle any size allocation, we have to keep track of the sizes on that free list. And

5:56 there was a header per block and a footer and it searched for a fit whenever we asked for an allocation. And we'd trim it if we needed to. We'd merge neighbors whenever we free. Any size works works, but it has some drawbacks where well, we have to search. Kind of lame, kind of slow, and it fragments over time. So today we get to restrict the problem, see how we can do things that will speed up our allocation. Kind of a taste of 454, although some of you are in 454. So some of the techniques are just supporting a few sizes, only supporting one size, or only supporting powers of two. Or a strategy is just to never free anything and only free stuff at one time.

6:44 So one technique is just giving size classes, like just have a whole bunch of size classes you support. So you could round up every request to one of a few size classes, like 16, 32,

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

In this course

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Jon Eyolfson.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.