Methods of Memory Management in MRI
summary
Covers how MRI actually allocates and reclaims memory: Ruby heap layout with 16KB pages, 40B object slots; tag‑pointer fixnum encoding and the 2^62 limit; mark‑and‑sweep, generational + tri‑color incremental tracing with write‑barriers and remembered sets; allocation slabs, bump pointer, eden/tomb behavior; introspection via GC.stat, ObjectSpace.dump and GC::Profiler; experimental heap‑splitting and a GitHub patch that groups classes/modules and yields a ~17% heap reduction on a Rails app — includes code, numbers, and measured results.
AI-written summary · about
chapters (19)
- 0:00Start
- 5:35Bear Metal
- 16:30Mark Phase
- 16:57Sweep Phase
- 17:12Mark & Sweep
- 18:37Generational
- 22:32Object Colors
- 22:48Algorithm
- 24:36Tri-Color Marking
- 29:38Page Layout
- 30:22Full Pages
- 34:37Encode Number 2
- 35:14Biggest Fixnum
- 36:40Fixnums are singletons
- 37:35Tagged Pointers
- 37:59Poor Reclamation
- 40:14Two Page Types
- 46:01GC::Profiler
- 46:44ObjectSpace.dump








