jemalloc is a malloc implementation developed by Jason Evans which is known to improve memory consumption of Rails apps, especially on Heroku. By default Ruby uses malloc from C to manage memory but it can run into memory fragmentation issues.
Salvatore Ferrucci