How I spent two weeks hunting a memory leak in Ruby (2015)
Interesting post, but I did want to chime in quickly and say that it&#x27;s pretty absurd to only have 1GB for a web application in 2016, even for a small one. This is why I&#x27;ve been dismissive of using Heroku for my projects, even though I run a lean stack. They have higher RAM options, but they are incredibly expensive. For the cost of a 14GB Heroku Dyno, I can buy a dedicated server off ebay with 32GB ECC every single month. I don&#x27;t use all of that RAM, but it&#x27;s nice to have some extra RAM to toss around when you need to in a pinch.<p>I get that it means you have to &quot;run a server&quot;, and <i>insert arguments for expensive cloud providers vs DIY servers here</i> but I don&#x27;t think it&#x27;s any less crazy than being forced to chase a GC white whale for two weeks on a tiny memory leak to avoid a huge rate hike on your hosting bill.<p>On an aside, I&#x27;ve only had one problematic memory leak with ruby ever (the infamously leaky RMagick), I threw this in every time I used the lib and it solved it for me:<p><pre><code>  GC.start(full_mark: true, immediate_sweep: true)
</code></pre>
Bit of a performance hit, but not enough to cause a problem for my use case.