~/talk

Compacting GC in MRI

Talkat RubyConf Colombia 2017 · 2017-09-08..09-09· [ruby, ruby-on-rails]
slides:none on file

Implemented a mark‑compact GC for MRI with a new GC.compact API and a simple two‑finger compaction algorithm; introduces forwarding objects, pin bits, and a GC move routine in a GitHub fork of Ruby 2.5 trunk. Measurement uses object_space JSON dumps and /proc/smaps (RSS/PSS/shared dirty) and targets Unicorn forked workers (compact then fork). Current limitations pin RB_GC_marked objects, hash keys, C↔Ruby dual refs and bytecode literals, yet 46% movable objects are compacted and microbenchmarks show ~150 KB PSS savings so far.

AI-written summary · about

  1. 0:00Start
  2. 6:28Exploring Memory in Ruby
  3. 8:23Ruby String
  4. 9:08Ruby Array
  5. 9:20Ruby Hash
  6. 10:18Ruby Fork
  7. 10:52OS Memory Copy
  8. 14:31Mark Phase
  9. 15:43Bitmap Marking
  10. 17:56Nakayoshi Fork Source
  11. 18:40Object Allocation
  12. 19:35Compact Before Fork
  13. 23:03Disadvantages
  14. 24:15Algorithm
  15. 24:26Object Movement
  16. 26:02Reference Updating
  17. 30:04Reference Update Helpers
  18. 31:15Pure Ruby References
  19. 31:46C References
  20. 34:20What can move?
  21. 34:49Hashing
  22. 35:50Dual References
  23. 37:24Global Variables (in C)
  24. 38:31String Literals
  25. 40:56Before Compaction
  26. 41:15After Compaction
  27. 42:30Measuring Rails Boot
  28. 42:46Output
  29. 44:07Heap Fragmentation
  30. 47:53Copying Memory
  31. 48:50Compaction 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.