Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Hunting down memory leaks
Sergey Alekseev
Hunting down memory leaks
Sergey Alekseev
What’s a memory leak?
Bloat vs. Leak
Get rid of a memory bloat first
*disable NewRelic developer_mode
in staging
How to hunt down a leak?
1) Find
2) Destroy
How to find a leak?
First look into
https://github.com/ASoftCo/leaky-
gems
The most effective way
Siege + New Relic + Skylight
/action-1 /action-2
New Relic – Transactions
• Most time consuming
• Slowest average response time
• Apdex most dissatisfying
• …
2 types: Ruby & C memory leaks
Ruby memory leaks
• Errno::ENOMEM
• GC.start
• ObjectSpace.count_objects
• ObjectSpace.each_object(String)
• GC.stat
C memory leaks
• Valgrind
• https://lbtwiki.cern.ch/bin/view/Online/Kcach
egrind
• Heap dump
Сергей Алексеев
Ruby developer, Founder @ ASoft.co
• https://github.com/sergey-alekseev
• info @ asoft.co
• http://sergeya...
Hunting down memory leaks in Ruby
Hunting down memory leaks in Ruby
Hunting down memory leaks in Ruby
Hunting down memory leaks in Ruby
Hunting down memory leaks in Ruby
Hunting down memory leaks in Ruby
Upcoming SlideShare
Loading in …5
×

Hunting down memory leaks in Ruby

806 views

Published on

Does the memory grow on your project? Are you tired of using OOM killers? Spent a lot of time debugging, but didn't find a leak source? Look into an effective way to find the leak source.

Published in: Software
  • Contact me if you need help with finding memory leaks in your project.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Hunting down memory leaks in Ruby

  1. 1. Hunting down memory leaks Sergey Alekseev
  2. 2. Hunting down memory leaks Sergey Alekseev
  3. 3. What’s a memory leak?
  4. 4. Bloat vs. Leak
  5. 5. Get rid of a memory bloat first *disable NewRelic developer_mode in staging
  6. 6. How to hunt down a leak? 1) Find 2) Destroy
  7. 7. How to find a leak? First look into https://github.com/ASoftCo/leaky- gems
  8. 8. The most effective way Siege + New Relic + Skylight
  9. 9. /action-1 /action-2
  10. 10. New Relic – Transactions • Most time consuming • Slowest average response time • Apdex most dissatisfying • …
  11. 11. 2 types: Ruby & C memory leaks
  12. 12. Ruby memory leaks • Errno::ENOMEM • GC.start • ObjectSpace.count_objects • ObjectSpace.each_object(String) • GC.stat
  13. 13. C memory leaks • Valgrind • https://lbtwiki.cern.ch/bin/view/Online/Kcach egrind • Heap dump
  14. 14. Сергей Алексеев Ruby developer, Founder @ ASoft.co • https://github.com/sergey-alekseev • info @ asoft.co • http://sergeyalekseev.by/#contacts

×