Recently some changes were made to the way Ruby stores objects of different sizes in memory. These changes impacted the way that the compaction handles fragmented memory inside the Ruby garbage collector.
In this talk I'll introduce the concepts of memory fragmentation and compacting GC's and discuss how Ruby implements compaction. I'll explore the consequences of the recent memory changes and take you on the journey I went on to explore some potential solutions, as well as the approach I eventually settled on.
Along the way we'll see some techniques to inspect Ruby's memory and introduce a tool I built, heapviz, that visualises the Ruby object space, allowing us to see the effect of compaction.