On Memory
summary
Shows concrete memory tools and surprises: uses object_space / objectspace.so and GC.stat to find live objects and allocation sites, and recommends the memory_profiler gem (Sam Saffron) and GC.profiler. Demonstrates lazy enumerator tradeoffs with measured results (45% fewer bytes but thousands more arrays; small inputs make lazy worse), shows memoization can retain huge objects, counts string allocations (500 vs ~203 vs 100 with interpolation), and warns define_method closures keep strings alive.
AI-written summary · about








