Building a Compacting GC for MRI
summary
Claims a working compacting collector for MRI with a concrete implementation: a GC.compact API, a two-finger compaction mover that leaves T_MOVED forwarding records, and a pinned_bits table to avoid moving C-referenced, literal, and hash-keyed objects. Uses ObjectSpace.dump_all, /proc instrumentation and PSS measurements, and interoperates with NakayoshiFork heuristics. On a Rails-ish workload about 46% of objects are movable and a small test shows ~150KB PSS savings; proof of concept succeeds but overall savings at production scale remain uncertain.
AI-written summary · about
chapters (22)
- 0:00Start
- 9:31Ruby String
- 10:15Ruby Array
- 11:07Ruby Fork
- 14:16Mark Phase
- 15:10Bitmap Marking
- 16:53Nakayoshi Fork Source
- 17:22Object Allocation
- 18:00Compact Before Fork
- 20:28Disadvantages
- 21:13Algorithm
- 22:55Reference Updating
- 26:24Reference Update Helpers
- 27:05Pure Ruby References
- 29:47Hashing
- 30:37Dual References
- 32:17String Literals
- 34:22Measuring Rails Boot
- 34:40Output
- 39:36Three Writing Systems
- 40:33Pronunciation
- 41:16Bone Script







