Senior Track Roadmap

Ruby: memory & GC mastery

Ruby's garbage collector is generational, and this course explains what it decides and why. It covers minor and major collections, promotion after three survivals, the write barrier and the remembered set. It shows how to find what triggers a major collection with GC.latest_gc_info, including the oldmalloc path, and how to reduce GC.stat to three ratios. It separates leaks from bloat, measures GC.compact and copy-on-write in forked workers, and weighs allocation changes and GC tuning against the defaults.

What you'll learn

  • ✓How generational collection, promotion and the write barrier work
  • ✓Finding the cause of a major collection with GC.latest_gc_info
  • ✓Reading GC.stat as occupancy, major share and churn ratios
  • ✓Telling a memory leak apart from bloat
  • ✓When GC.compact helps and how copy-on-write sharing decays in forked workers
  • ✓Measuring allocations and deciding whether to change GC settings
Free preview · Lesson 1 4 min read

The pause you did not schedule

Your p50 is 40 ms. Your p99 is 900 ms. The slow requests aren't slower queries, a different endpoint or one bad customer. They're scattered across everything, and when you line them up against process uptime, they arrive in a rhythm. Something in the process stops the world every few seconds, and…

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...