RailsConf 2023 - A pragmatic and simple approach to fixing a memory leak by Vincent Rolea

Fixing memory leaks with a pragmatic approach: Learn how to identify and solve memory-related issues in your Rails app using Vincent Rolea's step-by-step guide.

Key takeaways
  • The speaker shares a common problem where a memory leak is causing issues in their application, making it hard to debug.
  • To fix the issue, Vincent Rolea uses a pragmatic approach rather than relying on complex tools or theories.
  • He instruments the code to find the source of the memory leak, using techniques like binary search to locate the problematic code.
  • Instrumenting the code allows him to pinpoint the issue to the sidekick client, which is responsible for enqueuing jobs in Redis.
  • The speaker shares a graph showing the average memory usage of the worker, which helps identify the issue.
  • He discusses the trade-offs of scaling horizontally versus vertically, and how to choose the right approach for a specific problem.
  • The speaker emphasizes the importance of being pragmatic and focusing on solving the problem rather than getting caught up in complex theories or tools.
  • He shares a number of specific techniques and strategies for debugging and fixing memory leaks, including using sidekick client middlewares and reducing concurrency.
  • The talk concludes with Vincent sharing a success story where the team was able to fix the memory leak using a pragmatic approach.
  • He also mentions the importance of learning from failure and using those experiences to improve and grow as a developer.