~/talk

Parallel Ruby: Managing the Memory Monster

Talkat RubyConf 2019 · 2019-11-18..11-20· [ruby, web-performance]
links:none on file
slides:none on file

Claim: switching many single‑threaded Ruby processes to a threadpool causes runaway memory from OS‑heap fragmentation, not a Ruby object leak. Evidence: a 20‑thread demo that allocates 1MB per thread spikes past 1GB; setting MALLOC_ARENA_MAX=2 cuts usage to ~600–700MB; rebuilding Ruby with jemalloc reduces it further and reports ~15% memory and occasional 11% speed gains. Actionable outcome: change allocator or arena limit; the fixes stop the growth.

AI-written summary · about

  1. 0:00Start
  2. 0:53We run a lot of background jobs
  3. 1:48The Great Migration
  4. 3:33Side Lesson
  5. 14:49Option 2: Use a Different Memory Allocator
  6. 16:54So... What should you do?
~/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.