Rabbit Hole: Garbage Collection and Ruby's Future
summary
Walks the C path from Foo.new through allocation macros (rb_class_allocate_instance down to the rb_newobj substitution), shows how Value macros and embedded strings change layout, and measures object churn: a tiny script creates 14,000 objects, a simple Rails app 280,000 objects. Traces and tools include heap layout, ObjectSpace, ctags and dtrace. Empirical claim: New Relic sees GC drop 80ms to 42ms after upgrades; structural fixes — bitmap marking and the generational GC in 2.1 — enable copy‑on‑write and substantial practical wins.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:10Garbage collection overview
- 3:29Performance motivations
- 6:33The garbage collector basics
- 8:58Object allocation lifecycle
- 10:52Navigating Ruby's C code
- 14:11Role of macros in optimization
- 17:20Understanding the heap
- 18:55Tracing object creation
- 23:34The mark and sweep process
- 27:42Modern GC improvements
- 30:29Future directions and resources
- 33:28Q&A session
related talks
37mDown the rb_newobj() Rabbit Hole: Garbage Collection in Ruby
34mUnder the Hood of Ruby's Generational Garbage Collector
53mRuby.inspect
35mThe Hitchhiker's Guide to Ruby GC
21mUnderstanding Garbage Collection in Ruby
42mTweaking Ruby GC Parameters for Fun, Speed, and Profit
36mA Day in the Life of a Ruby Object
43mCat Care and Maintenance
