Memory leak during ruby ​​process after switching to OSX Lion

I upgraded to Lion a few years ago, and it has completely returned to the Ruby on Rails environment. I am installing RVM, different versions of Ruby and can't find a solution for this ... I think this was one of the worst decisions I could make for Lion. This only created problems for me.

In any case, I realized that rendering the page of my application (which works fine on a deployed server and locally on other machines as well) increases the memory of the ruby ​​process by 20-30 mb, which is crazy. Thus, you can imagine that after a while my ruby ​​process reaches 2 GB of memory, and my computer is no longer used.

I saw a lot of people who have problems upgrading to Lion, but I could not find a solution for my business.

Has anyone had the same problem? Any ideas how I can try to solve this problem?

thanks

+7
source share
2 answers

You can use memprof gem (which is no longer supported and does not work for Ruby above version 1.8.7) and memprof.com (Broken Link) to understand the essence of the problem.

You can also experiment using Passenger, Unicorn, or Thin instead of the default Webrick to see if this gives you a different behavior.

0
source

I don’t know how you could fix a memory leak, but you can offer one way to hide it and fix it.

If you want to learn Docker, you can keep your development environment inside the Docker container, while accessing the code on your local computer, as well as in the shared folder in Vagrant.

When you launch the Docker container, which starts, you can specify a limit on the amount of memory that the container can use. The rails server process may cause the container to crash and stop, but at least you won’t have to restart your computer.

Perhaps this will give you more opportunities for a deeper resolution of the problem.

Docker Launch Reference , see "Runtime Limits for CPU and Memory".

0
source

All Articles