Compacting GC in MRI
summary
An implementation of a compacting GC for MRI exists that actually moves objects using a two-finger compaction algorithm, updates pointers, and exposes a gc_compact entry in the branch; it finds about 46% movable objects on a Rails heap, skips objects fixed by rb_gc_mark, C globals and literal strings (bytecode points to literals), and so far reduces fork-induced page faults as measured with ObjectSpace dump JSON traces and smap/pss comparisons; production testing is ongoing.
AI-written summary · about
chapters (10)
- 0:00Introduction and speaker
- 3:00Copy-on-write optimization
- 11:42Page faults and GC impact
- 14:41Heap compaction concept
- 20:37Compaction algorithm steps
- 26:56Challenges in object movement
- 35:15Compaction results and visualization
- 39:44Memory measurement tools
- 40:32Current status and future work
- 41:18Conclusion and key takeaways
related talks
51mCompacting GC in MRI
19mReworking Memory Management in CRuby: A Practitioner Report
33mRails and the Ruby Garbage Collector: How to Speed Up Your Rails App
21mOn Memory
46mHalve Your Memory Usage With These 12 Weird Tricks
59mClosing Keynote
30mCaching Without Marshal
39mThe Life-Changing Magic of Tidying Active...
