Note that there are some explanatory texts on larger screens.

plurals
  1. POCan someone advise me on Rails memory consumption?
    text
    copied!<p>I'm working on a Rails application at the moment which seems to kill the memory on my iMac until I eventually have to restart. I have a 2.66 GHZ processor with 4GB Ram on OSX 10.6. </p> <p>When I boot the rails app, the memory consumption shows the following (ps aux | grep rails): </p> <pre><code>Gavin 726 0.0 3.8 2590812 158860 s000 S+ 9:27am 0:09.90 /Users/Gavin/.rvm/rubies/ree-1.8.7-2011.01/bin/ruby script/rails s </code></pre> <p>The RSS is at a cool 158,860 kb After a few requests to localhost, this number jumps up to: </p> <pre><code>Gavin 726 0.0 14.1 3031792 592888 s000 S+ 9:27am 0:27.00 /Users/Gavin/.rvm/rubies/ree-1.8.7-2011.01/bin/ruby script/rails s </code></pre> <p>592,888 kb!!</p> <p>and with general development use, it goes up again and again and again: </p> <pre><code>Gavin 726 1.5 25.0 3487516 1050180 s000 S+ 9:27am 0:59.29 /Users/Gavin/.rvm/rubies/ree-1.8.7-2011.01/bin/ruby script/rails s </code></pre> <p>I'm running REE using RVM ruby 1.8.7 (2010-12-23 patchlevel 330) [i686-darwin10.6.0], MBARI 0x6770, Ruby Enterprise Edition 2011.01 </p> <p>The app is using Rails 3.0.6 </p> <p>The application is not particularly SQL intensive and there are almost no associations included when records are loaded (not required in the architecture). </p> <p>Am I right in saying this is a memory leak or is there something else I should be looking at? </p> <p>Can anybody offer some advice on how I can solve this? </p> <p>Thanks!</p> <p>Here's a full list of the gems used just incase there are any known suspects in there: </p> <pre><code>source 'http://rubygems.org' gem "omniauth", "0.2.0" gem "fb_graph" gem 'rails', '&gt;=3.0.6' gem 'mysql2' gem "delayed_job" gem "rvm" gem "whenever" gem "less" gem "bcrypt-ruby", :require =&gt; "bcrypt" gem "twitter" gem "paperclip" gem "aws-s3" gem "RedCloth" gem "decent_exposure", :git =&gt; "git://github.com/voxdolo/decent_exposure.git" # Application monitoring services gem 'hoptoad_notifier', "&gt;=2.4.5" gem "newrelic_rpm", "&gt;=2.13.4" gem "yahoo-weather", "1.2.0", :require =&gt; false gem "json", "~&gt;1.4.6" gem 'will_paginate', :git =&gt; "git://github.com/mislav/will_paginate.git", :branch =&gt; "rails3" gem 'acts-as-taggable-on' gem "aasm", "&gt;=2.2.0", :require =&gt; "aasm" gem 'thinking-sphinx', '2.0.2', :require =&gt; 'thinking_sphinx' # These gems are not required on the Staging/Production server group :development, :test do gem 'capistrano' gem "capistrano-ext" gem "nifty-generators" gem 'factory_girl_rails', :git =&gt; "http://github.com/CodeMonkeySteve/factory_girl_rails.git" # Keep on top of the latest RSpec Gems gem "rspec-rails", :git =&gt; "git://github.com/rspec/rspec-rails.git" gem "rspec", :git =&gt; "git://github.com/rspec/rspec.git" gem "rspec-core", :git =&gt; "git://github.com/rspec/rspec-core.git" gem "rspec-expectations", :git =&gt; "git://github.com/rspec/rspec-expectations.git" gem "rspec-mocks", :git =&gt; "git://github.com/rspec/rspec-mocks.git" gem 'shoulda' gem "mocha" # gives us the mock_model method for mocha gem 'rspec-rails-mocha', '~&gt; 0.3.0' gem "faker" gem "autotest", "&gt;=4.4.6" gem "autotest-growl" gem "autotest-rails" gem "database_cleaner" gem "redgreen" gem "launchy" gem "faker" gem 'ruby-debug' gem "rcov" gem "rdoc" gem "ruby-prof" end </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload