# Ruby-prof's memory profiling Vs. my app

**URL:** <https://www.ruby-forum.com/t/ruby-profs-memory-profiling-vs-my-app/159466>\
**Category:** Rails\
**Created:** [February 4, 2009, 8:22pm UTC](https://www.ruby-forum.com/t/ruby-profs-memory-profiling-vs-my-app/159466 "2009-02-04T20:22:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![moredip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbce88/32.png) [@moredip](https://www.ruby-forum.com/u/moredip)\
**Post date:** [February 4, 2009, 8:22pm UTC](https://www.ruby-forum.com/t/ruby-profs-memory-profiling-vs-my-app/159466/1 "2009-02-04T20:22:13Z")

</div>

I’ve been using ruby-prof’s memory profiling mode to try to reduce the  
memory usage of an app, with ruby enterprise edition and rails 2.2.2. I  
setup a profiling test (as recommended in the ruby-prof docs) for a  
single action, and after my refactoring ruby-prof said I had cut memory  
usage by 1/3 and object allocations by 1/2.

After this, I setup a script to hit that action repeatedly with the same  
parameters and measure the amount of memory used by the mongrel process,  
once for my refactored code and once for point I branched from. This  
script tells me that I’ve actually made the memory usage worse by about  
10-20%.

Has anyone run into a discrepancy like this before?
