What causes Ruby memory bloat?
summary
Investigates why multi threaded Ruby on Linux balloons in memory and finds the OS allocator behavior — many per thread arenas that hoard gray pages — causes most of the bloat. Builds tools to dump and visualize allocator heaps, demonstrates that calling malloc_trim during GC or switching to jemalloc cuts residency dramatically (uploader claims ~70% reduction; others report 17–20% in production) at a cost of ~7–20% CPU; packages fixes as FullStack Ruby deb/rpm/docker binaries.
AI-written summary · about
chapters (5)
- 0:00Start
- 2:34A surprise announcement at the end
- 5:35PART 1 MEMORY ALLOCATION 101
- 9:03PART 2 RUBY MEMORY ORGANIZATION
- 20:13malloc_trim() Force freeing OS pages to the kernel
related talks
27mParallel Ruby: Managing the Memory Monster
39mPointers for Eliminating Heaps of Memory
45mClosing Keynote: Analyzing and Reducing Ruby Memory Usage
27mOptimizing Ruby's Memory Layout
46mHalve Your Memory Usage With These 12 Weird Tricks
34mUnder the Hood of Ruby's Generational Garbage Collector
46mRuby Memory Management Hacks
38mWhy I am excited about Ruby 2.1?
