There are many options available for tuning ruby memory management: https://github.com/ruby/ruby/blob/trunk/gc.c#L7420-L7444
The one that gets the most attention is RUBY_GC_HEAP_GROWTH_FACTOR, which is the only one Heroku suggests adjusting: https://devcenter.heroku.com/articles/ruby-memory-use#gc-tuning
I've often wondered what the drawback was for setting RUBY_GC_HEAP_GROWTH_FACTOR quite low for a webapp.