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

YouTube

Automatic GC Compaction in MRI

Ruby Central via YouTube

Overview

Explore the intricacies of automatic garbage collection compaction in MRI Ruby in this 34-minute conference talk. Delve into the evolution from manual to automatic compaction processes introduced in Ruby 2.7, examining implementation techniques like read barriers and concurrent GC execution. Gain insights into heap management, memory usage optimization, and the challenges faced during automation. Analyze the compaction process, including sweep operations, reference updates, and crash handling. Investigate Ruby's class hierarchy, page allocation, and memory usage patterns. Learn about performance bottlenecks, instrumentation tools, and the impact of automatic compaction on garbage collection efficiency. Discover how to control auto-compaction and compare its performance to previous implementations.

Syllabus

Intro
Heap Compaction In a Rails app
Heap Before Compaction
Compaction Process
Compaction Goals
Heap Comparison Before and After Compaction
Empty Destination Required! Movement
Sweep Process After Marking
Sweep + Update References Sweep is Paused
Sweep Continues Finish up!
Ruby Class Hierarchy
Sweep Process Sweeping Classes
Sweep + Move Process After Marking
Crash Backtrace
mprotect() requirements
Ruby Page Allocation
Memory Usage Over Time jemalloc
Old Size vs New Size
Page Widen Diff
Compact + Read Barrier
Using Instruments
Bottleneck: mprotect
Comparing to Master
Automatic Compaction in Action
Auto Compaction Control
Major GC: Objects Per Second (higher is better)

Taught by

Ruby Central

Reviews

Start your review of Automatic GC Compaction in MRI

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.