Pointers for Eliminating Heaps of Memory
summary
Covers concrete changes in Ruby 2.6: uses Malloc Stack Logging on macOS to find where mallocs come from, patches the loaded_features cache to share and eliminate string allocations (about 50% fewer string allocations for one example) and replaces the instruction-sequence mark array with Direct ISeq Marking, cutting boot-time array allocations from ~35k to ~8.5k (≈34% fewer objects) and reducing overall process memory ~4–6% depending on how many files an app loads.
AI-written summary · about
chapters (22)
- 0:00Start
- 7:36Malloc Stack Logging
- 8:23Dump Malloc Logs
- 8:49Log File Size
- 8:59File Contents
- 9:20Reconciling Live Memory
- 14:22Cache Structure
- 14:41Generation Algorithm
- 14:56Key Generation
- 18:27Output
- 18:58Malloc Logging
- 21:42Stack VM
- 22:59Processing Phases
- 25:43Optimization Pass
- 26:13Byte Code Translation
- 27:55Hello World
- 29:16VM Implementation
- 30:48Object Allocations
- 32:18ISeq Layout
- 37:21Basic Rails App
- 37:53Process Memory: -6%
- 38:23Actual Code
related talks
45mClosing Keynote: Analyzing and Reducing Ruby Memory Usage
27mOptimizing Ruby's Memory Layout
29mWhat causes Ruby memory bloat?
46mRuby Memory Management Hacks
34mHow to optimize Ruby internal.
46mHalve Your Memory Usage With These 12 Weird Tricks
27mParallel Ruby: Managing the Memory Monster
33mFixing Performance & Memory problems
