Angelina Ballerina Learns About Memory Allocation
summary
An app that generates huge Excel files triggers Heroku request timeouts (>30s) and memory quota exceeded errors; the diagnosis traces to retained versus transient Ruby objects in the spreadsheet path. The talk states Ruby uses mark‑and‑sweep with generational and incremental GC, notes no compacting, and gives concrete numbers — 408 slots per heap page at ~40 bytes per slot — and shows using GC.stat, GC::Profiler and ObjectSpace plus Rails gems to find which objects stay retained and where fixing allocation reduces OOMs.
AI-written summary · about
chapters (27)
- 0:00Start
- 3:33Angelina Ballerina
- 3:51Angelina Loves To Dance
- 5:49Request Timeout Errors
- 6:08Memory Quota Exceeded Errors
- 6:36Memory Quota Exceeded
- 6:53Webserver Graph
- 7:20Basic Terms
- 7:48Types of Memory Stack
- 8:30Malloc
- 10:28Bump Pointer Allocation
- 11:25Garbage Collection
- 14:24Stack Allocation
- 14:43Garbage Collectors
- 19:23Reference Counting
- 21:16Memory Fragmentation
- 21:43Mark-and-Sweep
- 26:51Write Barrier
- 27:41Incremental Garbage Collection
- 32:49Gc Stat
- 33:01Heap-Allocated Pages
- 34:22Heap Free Slots
- 34:38Heap Final Slots
- 35:11Total Allocated Objects
- 36:08Gc Profilers
- 36:28The Object Space Library
- 38:29Thank You
related talks
27mParallel Ruby: Managing the Memory Monster
39mMemory Efficient Java
27mOptimizing Ruby's Memory Layout
53mPlugging Memory Leaks With The Chrome Dev Tools
50mOptimizing Performance of Web Apps: Removing Bottlenecks for a Better Experience
41mSpeed up Rails, Speed up Your Code
29mTidying Active Record Allocations
21mMemory Efficient Java
