Peter Zhu

@peterzhu.ca

Staff Developer at Shopify. Ruby core committer. Photography geek. Mastodon: @peterzhu2118@ruby.social Instagram: @peterzhu.photos

Ruby has a new moving GC. I just merged moving Immix in the MMTk Ruby binding. This is exciting as its the first GC that dynamically detects fragmentation in the heap and performs defragmentation. Performance isn't too great yet but I'm working on it! github.com/ruby/ruby/pu...

Implement moving Immix in MMTk by peterzhu2118 · Pull Request #15744 · ruby/ruby

This commit implements moving Immix in MMTk, which allows objects to move in the GC. The performance of this implementation is not yet amazing. It is very similar to non-moving Immix in many of the...

github.com

I implemented Ruby's heap algorithm in MMTk in a day and 100 lines. Ruby's default GC is 10k+ lines. This doubles MMTk's performance from over 2x slower to almost on par. And I still haven't unlocked MMTk's true powers like generational GC or moving GC. github.com/ruby/mmtk/pu...

Implement Ruby heap by peterzhu2118 · Pull Request #54 · ruby/mmtk

This heap emulates the growth characteristics of the Ruby default GC's heap. By default, the heap grows by 40%, requires at least 20% empty after a GC, and allows at most 65% empty before it sh...

github.com

Friday was my last day of an incredible journey at Shopify. In the past 5 years, I had the privilege of working on some cutting edge projects to advance Ruby with some of the most talented and well-known developers. Shopify will always have a very special place in my heart.

Shopify sponsors and collaborates with academia to take Ruby to new heights. We're working with Australian National University to integrate Memory Management Toolkit into Ruby. Earlier this year, we published a paper about it. Today, we wrote a blog post: railsatscale.com/2025-09-16-r...

Reworking Memory Management in CRuby

Shopify sponsors and collaborates with academia to take Ruby to new heights. In this post, we give an overview of what we’ve built in collaboration with the Australian National University.

railsatscale.com

If you missed it, my recent #rubykaigi talk “Modular Garbage Collectors in Ruby” covered: ⚙️ Features the current Ruby GC lacks 🔄 Implementation of the Modular GC feature in Ruby 3.4 🔨 What MMTk is and the integration with Modular GC The recording will be up in a few months!

Peter on stage at RubyKaigi