How to profile a ruby ​​product in rails application memory

My Ruby on Rails application runs on Heroku with a speaker with 512 megabytes of RAM. It uses almost all of the RAM right from the launch of the application, and it gets worse. I do not load large amounts of data from the database at startup, so I do not understand why it uses so much memory.

How do I profile my application in production so I can understand where the memory usage comes from? I understand that I have the opportunity to add another dynamo or increase dynamic memory, but I want to understand what happens first.

+1
ruby-on-rails heroku
source share
1 answer

Heroku has a log-runtime-metrics function to track memory usage.

You can run this to enable this:

 heroku labs:enable log-runtime-metrics 

and memory usage will be displayed in the server log.

See Heroku Labs: log-runtime metrics for more information .

Alternatively, you can use New Relic to profile memory.

See more details.

Another awesome resource I recommend for memory profiling is rbkit

+2
source share

All Articles