~/talk

The Hitchhiker's Guide to Ruby GC

Talkat RubyConf 2015 · 2015-11-15..11-17· [ruby]
slides:none on file

Shows that garbage collection, not just databases or algorithms, is the real culprit: a Sinatra app hits about half a million live objects on boot, Ruby 1.9.3 runs 122 GC runs → 66 runs (4.4s → 3s), and switching to Ruby 2.0 (bitmap marking + COW) cuts GC and require time. Case study with Unicorn exposes COW blowup across forks. Remedies: profile (ruby-prof, GC.stat), upgrade Ruby, and cautiously tune malloc_limit (default ~8MB), heap_min_slots and heap_growth_factor (1.8→lower).

AI-written summary · about

  1. 0:00Intro
  2. 0:28The Hitchhiker's
  3. 3:17Ruby Wizardry RUBY
  4. 5:38We're talking MRI
  5. 13:19Wild White Object Appears!
  6. 13:49Write Barriers
  7. 15:15GC Tuning
  8. 21:57The RValue
  9. 23:09Heaps on Heaps (1.9.3)
  10. 24:33The Free List
  11. 24:46Copy on Write When our production processes call fork, the new child process shares all memory with the parent
  12. 26:19Memory in Ruby 2.0
  13. 26:47Bitmap Marking
  14. 28:00Upgraded to 2.0 • Leveraged copy on write
  15. 28:37Profiled
  16. 29:21Tuned the GC
  17. 30:31Credits && Further Reading
  18. 31:48Turning it to 11
  19. 33:54Questions?
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.