Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Ruby - 2.1 brought generational GC to Ruby and instrumentation support. In this talk, I am going explain: How it works? How it affects users and C extension authors? Visualize object allocation/deallocation in realtime, demonstrate how different GC tuning options affect your app. Help us caption & translate this video! http://amara.org/v/F1kM/
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In the talk titled 'Under the Hood of Ruby's Generational Garbage Collector,' Hemant Kumar explores the advancements in Ruby's memory management, specifically focusing on the generational garbage collection (GC) introduced in Ruby 2.1. The presentation covers the evolution of GC, its current functioning, and the implications for both developers and users. Key points discussed include: - **Historical Context**: The transition from the traditional mark-and-sweep approach used in Ruby 1.8 and 1.9, which required traversing the entire heap, to the more efficient generational GC in Ruby 2.1. - **Generational Garbage Collection**: The concept that most objects in Ruby die young, surviving only a few collections, which leads to faster garbage collection as minor GC skips older objects. Issues arise when references in old generation objects point to new generation objects, risking accidental deletion during GC. - **Solution with Remembered Sets**: To prevent unintended deletions, Ruby uses a remembered set that includes modified old objects, thus ensuring proper garbage collection during minor collections. - **Challenges with C Extensions**: The danger posed by C extensions that can bypass Ruby's GC awareness, leading to potential memory issues if not managed properly. - **Write Barriers Implementation**: To manage the interaction between Ruby objects and C extensions, write barriers classify objects into 'shady' and 'sunny' to facilitate correct GC behavior. - **ArbiKit Introduction**: The presentation introduces ArbiKit, a low-overhead Ruby profiler that allows developers to monitor memory utilization easily in production, offering insights into object allocation and garbage collection performance. - **GC Tuning**: Hemant discusses how to tune the garbage collector using environment variables, demonstrating how changes to heap slots and growth factors affect application performance. - **Live Demo**: A live demo showcases the ArbiKit profiler's capabilities, including real-time monitoring of GC stats and memory size, reinforcing the importance of insightful profiling in Rails applications. In conclusion, Kumar emphasizes the importance of using Ruby's provided APIs for custom data structures to avoid complications with memory management. He encourages the audience to engage with the tools available for profiling and refining their applications effectively. The overall goal of the talk is to assist developers in navigating Ruby's garbage collection landscape and utilize available profiling tools for better performance.
Suggest modifications
Cancel