How can I find a memory leak on Heroku?

前端 未结 2 1182
别那么骄傲
别那么骄傲 2021-02-05 11:18

I have a Rails 3.2.8 app running on Heroku Cedar with Ruby 1.9.3. The app runs fine when it launches but after a day or so of continuous use, I start to see R14 errors on my log

2条回答
  •  不知归路
    2021-02-05 12:01

    Install the New Relic add-on. It has a bunch of useful metrics that you can use to find out the source of the leak. I think its generally a better idea to try to see which part of the code takes the longest to execute and perhaps try to optimize that, rather than tweak the GC outright.

    Some of the nice features New Relic includes is being able to pinpoint the source of the longest running SQL query, for example. I encourage you to give it a try.

提交回复
热议问题