Chris Kelly
Ranked 10 in Phase 2 with a weighted final score of 242

About the author

Like the ancient civilizations uncovered by anthropologists, the tools we use say something about who we are. Chris joyfully uses Ruby every day. He believes that flourishing is the key to happiness, servers are an anachronism, and the person that will create SkyNet has already been born. At New Relic he is a Happiness Engineer, where they let him work on things that makes someone’s day better. His stuff lives in San Francisco where he visits it from time to time. Chris tweets occasionally, speaks often, and drinks coffee in between.

Down the rb_newobj() Rabbit Hole: Garbage Collection and a Glimpse into Ruby's Future


Garbage collection is one of the pillars of Ruby's performance story, but getting into the inner workings of MRI's garbage collector is a bit hairy. If you want to explore the garbage collector then you're going to have to get your hands deep into C code.

We're going to take a walk through the C internals from through garbage collection in Ruby's MRI. We’ll examine the idioms and optimizations in the C source and leave you feeling comfortable to explore the code yourself.

At the end of the rb_newobj() rabbit hole is a whole world of garbage collection. Major changes have been made in MRI's garbage collector from Ruby 1.8 through 2.0: changes intended to make Ruby more performant, changes that can capitalize on MRI's roots in UNIX. From mark-and-sweep to copy-on-write and bitmap marking, we'll see what the future of Ruby performance might look like by peering through the window of the garbage collector.

Previous Next


  • 7fe945668a4fc098e886e20dea71d2ee?d=retro Zachary Scott suggested 8 months ago


    I wish I could vote for this more than once!

  • 9287985f53b36866bb3c639a6aedc867?d=retro John Pagonis suggested 8 months ago

    Jan's suggestion was what I was thinking as well.

    This looks really promising :-)

  • Profile_image?user_id=115406098&size=bigger Jan Stępień suggested 8 months ago

    It would be great to see a short overview of approaches to garbage collection in other Ruby implementations and a comparison with MRI's GC, if time allows.