Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Memory leaks do not come by often in modern Rails applications. But when they do, the road to a fix can be tortuous: it often requires extensive knowledge of memory management in Ruby, experience on profiling tools as well as properly setup application monitoring. As a developer working on Product, one does not always have the bandwidth to learn about the subject, and setup custom tools: project deadlines could be nearing, or your expertise needed on a shiny new project that just came in. In this talk, I’ll walk you through a real memory leak issue we encountered on one of our background worker, and how we fixed it with no custom tooling using simple technics.
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
This video, presented by Vincent Rolea at RailsConf 2023, addresses a practical approach to fixing memory leaks in Ruby on Rails applications. While memory leaks are not common in modern Rails applications, when they occur, they can be challenging to resolve without the right knowledge and tools. Vincent walks the audience through a real-world case of a memory leak encountered in a background worker and how they managed to eliminate it using straightforward techniques without custom tooling. ### Key Points Discussed: - **Introduction to Memory Leaks:** Vincent describes a situation where developers encounter unexpected application behavior due to memory usage increases that lead to worker crashes. - **Background on the Presenter:** Vincent shares his background and involvement in product development at Turia, acknowledging the support from his team and his wife. - **Case Study of a Memory Leak:** The talk centers on a memory leak identified during the support rotation at Turia involving a background worker using Sidekiq that was consistently exceeding the memory limit. - **Initial Analysis:** Vincent explains the behavior of their memory usage graph, which showed spikes and slow growth that indicated a potential memory leak. - **Methodology for Investigation:** The methodology employed includes: - Analyzing current configurations and scaling resources. - Splitting queues to see if the problem is isolated to a particular type of job. - Reducing concurrency settings on the worker to limit the simultaneous jobs. - **Determining the Cause:** After various troubleshooting steps and using existing monitoring tools, the team discovered the issue stemmed from how one specific analytics job was implemented, leading to excessive memory retention. - **Innovative Solution:** The solution involved creating a quarantine queue where jobs could be tested for leakage, allowing a binary search approach to efficiently locate the source of the leak without extensive instrumentation. - **Final Implementation:** The leak was resolved by revising how the analytics job instantiated objects, converting it to a method that reused an analytics object instead of creating new instances each time. ### Takeaways: - Tackling complex problems can be simplified by approaching them from various angles. - Employing a method like binary search can significantly reduce the effort needed to find solutions in large sets of data or jobs. - The discussion emphasizes the importance of pragmatic approaches in software quality management, enabling developers to address issues effectively under time constraints. Vincent concludes with a reminder that taking a step back to reassess a problem can often lead to simpler and more efficient solutions. He invites attendees to engage in further discussions after the presentation.
Suggest modifications
Cancel