O'Reilly logo

Ruby Under a Microscope by Pat Shaughnessy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. Garbage Collection in MRI, JRuby, and Rubinius

image with no caption

The garbage collector is where Ruby objects are born and where they die.

Garbage collection (GC) is the process high-level languages like Ruby use to manage memory for you. Where do your Ruby objects live while you’re using them? How does Ruby clean up objects your program no longer uses? Ruby’s GC system solves these problems.

Garbage collection is not unique to Ruby. The first implementation of garbage collection was in the Lisp programming language, invented by John McCarthy around 1960. Like Ruby, Lisp manages memory for you automatically using garbage collection. Since its invention, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required