I created a controller function for build a backup of database or some part of it, but after created the files e sent them, the allocated memory doesn't released.
The memory use report made with rack-mini-profiler gem show that the most part of memory is occupied by ActiveReccord and it doesn't released in the end. The full report is here.