~/talk

Keynote: Exploring Memory in Ruby - Building a Compacting GC

Talkat RubyConf MY 2017 · 2017-10-12..10-13· [ruby]
slides:none on file

Builds a mark‑and‑compact GC for MRI that exposes GC.compact, implements two‑finger compaction with forwarding T_MOVED entries and a GC_update_references pass, and adds a pin‑bits table to avoid moving RB_GC_marked objects, hash‑keyed objects, C‑extension globals and literals. On a test Rails boot 46% of objects are movable; a synthetic CoW measurement shows ~154 KB PSS savings after compaction. Uses ObjectSpace.dump_all to map object addresses and /proc/<pid>/smaps to measure RSS/PSS; code and tooling live in a GitHub fork for inspection.

AI-written summary · about

  1. 0:00Start
  2. 4:51Exploring Memory in Ruby
  3. 6:53Ruby String
  4. 8:11Ruby Array
  5. 8:21Ruby Hash
  6. 9:32Ruby Fork
  7. 10:06OS Memory Copy
  8. 13:51Mark Phase
  9. 14:44Bitmap Marking
  10. 16:45Nakayoshi Fork Source
  11. 17:24Object Allocation
  12. 18:21Compact Before Fork
  13. 21:12Disadvantages
  14. 22:06Algorithm
  15. 22:16Object Movement
  16. 23:56Reference Updating
  17. 25:48Usage
  18. 28:00Reference Update Helpers
  19. 29:15Pure Ruby References
  20. 30:09C References
  21. 32:27rb_gc_mark
  22. 33:17Hashing
  23. 34:22Dual References
  24. 36:04Global Variables (in C)
  25. 37:03String Literals
  26. 38:01What can move?
  27. 39:11Before Compaction
  28. 39:34After Compaction
  29. 40:15ObjectSpace.dump_all
  30. 40:55Measuring Rails Boot
  31. 41:11Output
  32. 41:56Heap Fragmentation
  33. 43:43proc/{PID}/smaps
  34. 44:58RSS vs PSS
  35. 45:32Copying Memory
  36. 45:49Shared Dirty, PSS, RSS
  37. 46:16Compaction Impact
~/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.