Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

The Bug that Forced Me to Understand Memory Compaction

Ruby Central via YouTube

Overview

Dive into the intricacies of Ruby memory management in this 33-minute conference talk by Emily Giurleo at Ruby Central. Explore how a single bug report led to a deep understanding of heap allocation, garbage collection, and memory compaction in Ruby 2.7. Learn about the implementation of Ruby objects in C, the challenges of memory bloat, and the introduction of manual memory compaction. Discover the interplay between C extensions and garbage collection, including mark callbacks and compaction techniques. Follow along as Giurleo unravels the mystery behind a specific bug, presents the solution, and shares valuable insights gained from this investigative journey. Gain a comprehensive understanding of Ruby's memory management system and its evolution through this informative and engaging presentation.

Syllabus

Intro
BSON gem
Ruby heap
Allocating memory
Mark and sweep
The heap after GC
Reality check
Memory bloat
What I'd learned so far
Ruby objects in C
Declaring new Ruby types
Memory compaction and C extensions
Garbage collection and C extensions
Mark callbacks
Garbage collection with mark callback
Marking long-lived objects Extension VALUE greeting
Mark and pin
Elementary, my dear
The suspects
The culprit
The solution
Moving forward
rb_gc_mark_no_pin()
Compaction callback
What I learned
Sources
Summary

Taught by

Ruby Central

Reviews

Start your review of The Bug that Forced Me to Understand Memory Compaction

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.