【发布时间】:2011-08-05 20:02:13
【问题描述】:
我目前正在开发一个 Rails 应用程序,这似乎是致命的 我的 iMac 上的内存,直到我最终不得不重新启动。 我在 OSX 10.6 上有一个 2.66 GHZ 处理器和 4GB 内存。
当我启动 rails 应用程序时,内存消耗显示如下 (ps aux | grep rails):
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
RSS 为 158,860 kb 在对 localhost 进行几次请求后,这个数字会跳到:
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
592,888 KB!!
并且随着一般的开发使用,它会一次又一次地上升,并且 再次:
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
我正在使用 RVM 运行 REE ruby 1.8.7(2010-12-23 补丁级别 330)[i686-darwin10.6.0],MBARI 0x6770, Ruby 企业版 2011.01
该应用正在使用 Rails 3.0.6
该应用程序不是特别密集的 SQL,几乎有 加载记录时不包含关联(在 建筑学)。
我说这是内存泄漏是对的还是有其他问题 我应该看看?
有人可以就我如何解决这个问题提供一些建议吗?
谢谢!
这里是使用的宝石的完整列表,以防万一有任何已知 里面的嫌疑人:
source 'http://rubygems.org'
gem "omniauth", "0.2.0"
gem "fb_graph"
gem 'rails', '>=3.0.6'
gem 'mysql2'
gem "delayed_job"
gem "rvm"
gem "whenever"
gem "less"
gem "bcrypt-ruby", :require => "bcrypt"
gem "twitter"
gem "paperclip"
gem "aws-s3"
gem "RedCloth"
gem "decent_exposure", :git => "git://github.com/voxdolo/decent_exposure.git"
# Application monitoring services
gem 'hoptoad_notifier', ">=2.4.5"
gem "newrelic_rpm", ">=2.13.4"
gem "yahoo-weather", "1.2.0", :require => false
gem "json", "~>1.4.6"
gem 'will_paginate', :git => "git://github.com/mislav/will_paginate.git", :branch => "rails3"
gem 'acts-as-taggable-on'
gem "aasm", ">=2.2.0", :require => "aasm"
gem 'thinking-sphinx', '2.0.2', :require => '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 => "http://github.com/CodeMonkeySteve/factory_girl_rails.git"
# Keep on top of the latest RSpec Gems
gem "rspec-rails", :git => "git://github.com/rspec/rspec-rails.git"
gem "rspec", :git => "git://github.com/rspec/rspec.git"
gem "rspec-core", :git => "git://github.com/rspec/rspec-core.git"
gem "rspec-expectations", :git => "git://github.com/rspec/rspec-expectations.git"
gem "rspec-mocks", :git => "git://github.com/rspec/rspec-mocks.git"
gem 'shoulda'
gem "mocha"
# gives us the mock_model method for mocha
gem 'rspec-rails-mocha', '~> 0.3.0'
gem "faker"
gem "autotest", ">=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
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 memory memory-leaks