What do you use for memory profiling a Rails project?

I’m trying to figure out the best way to determine what’s eating up memory in my Rails application. I don’t have any memory leaks, but I’m maxing out my free Heroku dyno. I highly suspect it’s that page caching I’ve enabled. But I don’t want to blindly make changes. What do you use, or have you used, and what do you recommend?

I think New Relic may be great, but my free trial has expired so I can’t use it for this. An 8 year old blog post on KCachegrind looks nice but it’s from back when Ruby 1.8.7 came out. What I’m currently working working on trying is rack-mini-profiler which has a excellent blog post posted within the past year and so I’m hopeful about this one. Lastly has anyone used memcahce-as-a-service (MemCachier) and does that help this kind of situation?

This is a new area for me so your input is greatly appreciated!

1 Like

By the way guys, rack-mini-profiler is AMAZING! :grinning:

1 Like

Nothing like analyzing all of the strings loaded into memory and finding T.S. Eliot using memory.

Now the light falls
Across the open field, leaving the deep lane
Shuttered with branches, dark in the afternoon,
Where you lean against a bank while a van passes,
And the deep lane insists on the direction
Into the village, in the electric heat
Hypnotised. In a warm haze the sultry light
Is absorbed, not refracted, by grey stone.
The dahlias sleep in the empty silence.
Wait for the early owl.
– T.S Eliot

Yup that’s what I use too :023:

I haven’t really used this that much but there is GitHub - schneems/derailed_benchmarks: Go faster, off the Rails - Benchmarks for your whole Rails app which I think has some memory profiling capabilities.

2 Likes