~/talk

Compacting Heaps in Ruby 2.7

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

Ruby 2.7 includes a manual heap compactor integrated with the GC and the talk explains exact memory layout, a two‑finger compaction algorithm, pinning bits, compaction callbacks and a rb_gc_location API for extensions. The patch is multi‑year work, initially pins about 3% pinned → 10% smaller heap on a Rails app and later drops to ~1% pinned; object_id shifts to a monotonic object_id. Prototype works but is slow, requires GC.compact today and aims for automatic compaction in Ruby 3.0.

AI-written summary · about

  1. 0:00Start
  2. 3:54Ruby Cores
  3. 4:22Pipeline Operator
  4. 4:41Smile Operator
  5. 9:39Efficient Memory Usage
  6. 10:35CPU Cache Hits
  7. 14:18Fragmented Memory
  8. 16:34Ruby's Heap Layout
  9. 18:32Moving Objects
  10. 19:46Updating References
  11. 20:55Object Movement
  12. 21:38Reference Updating
  13. 22:25Finding References
  14. 24:00Array
  15. 24:34Hashes
  16. 27:42Yajl Mark Function
  17. 28:41Pinning Bits
  18. 31:47Compaction Callback
  19. 32:10Problem Object Graph
  20. 33:35Compilation Process
  21. 33:53RubyVM Instruction Sequence
  22. 35:59Problem Code
  23. 38:18object_id is based on location
  24. 39:50Object ID Collisions
  25. 40:12Collision Resolution
  26. 40:47GC Cleanup
  27. 43:24Basic Rails Application
  28. 45:25Sliding Compaction
  29. 45:45Fixed Width Layout
~/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.