Faster Apps, No Memory Thrash: Get Your Memory Config Right
summary
Explains how Ruby memory sizes, slots vs big objects, and generational GC map to real slowdowns, and gives concrete fixes: use GC.stat dumps (and GC.start variants) to read live_slots, free_slots, malloc_limit and old malloc thresholds; run the app to warm up, save those stats, then set the environment variables (heap slots and malloc limits) so processes start at the right size with the provided mem gem; prefer destructive operations (String#<<, Array#concat) to cut allocations; switch to jemalloc for ~10–12% end-to-end speedups.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:30Understanding Ruby objects
- 4:30Garbage collection basics
- 7:49Memory allocation cycles
- 10:05Strategies for memory optimization
- 12:24Debugging memory issues
- 13:52Tuning memory configurations
- 15:44The mmm tool and warmup
- 19:34Optimizing with jemalloc
- 23:03Best practices for Ruby performance
- 25:11Advanced diagnostics
- 29:08GC profiler and Q&A
related talks
29mImprove Performance Quick and Cheap: Optimize Memory and Upgrade to Ruby 2.1
33mRails and the Ruby Garbage Collector: How to Speed Up Your Rails App
39mPointers for Eliminating Heaps of Memory
42mTweaking Ruby GC Parameters for Fun, Speed, and Profit
46mHalve Your Memory Usage With These 12 Weird Tricks
29mWhat causes Ruby memory bloat?
45mClosing Keynote: Analyzing and Reducing Ruby Memory Usage
38mWhy I am excited about Ruby 2.1?
