开发模式下会导致Rails内存泄漏

问题描述

| 导轨3.0.7 / REE 我在开发中看到此问题,设置config.cache_classes = false可解决此问题。但是,这对于开发人员来说不是可接受的解决方案。 这个问题很烦人。有些请求泄漏了40mb-结果我的服务器进程非常快地达到了2GB的内存,并且一切都停止了。 bleakhouse显示了许多“ active_model / attribute_methods.rb:279 \”实例,但我真的不知道该怎么做。也许我的AR类正在泄漏某些东西? 我尝试了一些消除方法的过程,这些过程会导致某种形式的成功。然后,我删除该功能并继续前进,只看到问题再次发生,这使我认为它是内部的一些rails或gem / plugin。但是,在插件中玩带有我的宝石的消除游戏的过程确实很困难,因为没有它们,整个控制器都会跟踪堆栈。 我目前的想法是,我需要一些直接的方法来发现此(这些?)内存泄漏。 同样,就其价值而言,Rails 2.3.x从来都不是问题。我当然不能责怪Rails 3.x,因为3.x升级还包括许多gem / plugin更改-所以谁确切知道是什么引入了它。 解决这个问题和/或更好地解释暗室输出的建议将不胜感激。谢谢! 暗淡的房屋输出:
91323 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activemodel-3.0.7/lib/active_model/attribute_methods.rb:279:__node__
79903 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activemodel-3.0.7/lib/active_model/attribute_methods.rb:278:__node__
28979 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activerecord-3.0.7/lib/active_record/attribute_methods/read.rb:80:__node__
22828 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activemodel-3.0.7/lib/active_model/attribute_methods.rb:278:Proc
19216 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activemodel-3.0.7/lib/active_model/attribute_methods.rb:274:__varmap__
17314 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:404:__node__
16368 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:175:__node__
15112 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/hpricot-0.8.2/lib/hpricot/blankslate.rb:59:__node__
15082 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activesupport-3.0.7/lib/active_support/core_ext/array/wrap.rb:40:Array
14899 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activerecord-3.0.7/lib/active_record/attribute_methods.rb:21:String
14275 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activerecord-3.0.7/lib/active_record/attribute_methods/write.rb:14:__node__
11429 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activemodel-3.0.7/lib/active_model/attribute_methods.rb:274:__node__
11416 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activemodel-3.0.7/lib/active_model/attribute_methods.rb:279:String
11415 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activemodel-3.0.7/lib/active_model/attribute_methods.rb:278:String
11414 /Users/jsharpe/rubypatch/lib/ruby/1.8/set.rb:158:String
11414 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activemodel-3.0.7/lib/active_model/attribute_methods.rb:337:__varmap__
11414 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activemodel-3.0.7/lib/active_model/attribute_methods.rb:280:__node__
11414 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activemodel-3.0.7/lib/active_model/attribute_methods.rb:272:String
11414 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activemodel-3.0.7/lib/active_model/attribute_methods.rb:267:__varmap__
10937 /Users/jsharpe/.rvm/gems/ruby-1.8.7-p334@testapp/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:407:__node__
    

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...