Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Memory leak after upgrade Rails 5.2 to 6.0.0

Has anyone experienced this? We upgraded a project from Rails 5.2 to Rails 6.0.0 and after this, the memory consumption skyrocketed... In the release candidate environment, it works fine, but in production, the container dies because of the memory usage... The instances we have in 5.2 can do just fine with 1GB RAM, but the instances we test for Rails 6.0.0 dies immediately, even if we give them 4GB ram.

We already tested https://github.com/schneems/derailed_benchmarks, but the require gems just increased like 10 MiB in total.

We have some heavy queries but we don't know why this happens in Rails 6 and not in Rails 5.

like image 723
OiciTrap Avatar asked Sep 13 '19 17:09

OiciTrap


People also ask

What is memory leak in rails?

A memory leak is an unintentional, uncontrolled, and unending increase in memory usage. No matter how small, eventually, a leak will cause your process to run out of memory and crash.


1 Answers

This hugely depends on what gems you have. Also, I would start by making use of a monitoring tool like Scout or NewRelic to understand where/how is the leak happening.

like image 172
Alan Joseph Avatar answered Oct 21 '22 03:10

Alan Joseph