Profiling your memory usage in Ruby

Hi, After spending some time investigating about options to profile code in Ruby and Ruby on Rails I have found my best option: def get_memory_usage `ps -o rss= -p #{Process.pid}`.to_i end before = get_memory_usage print “BEFORE: ” + before.to_s [your code to profile] after = get_memory_usage print “AFTER: ” + (after-before).to_s If we want to…